-
-
Save sammacbeth/96b938d94d49451020fdfba7e80c57d8 to your computer and use it in GitHub Desktop.
Minimal Webextension to reproduce chrome messaging issue on Chrome 71. Test site: http://jsfiddle.net/jqwidgets/6q7h9xcj/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome.runtime.onMessage.addListener((message, sender, respond) => { | |
console.log('got message', message); | |
respond({ action: 'reply' }); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('mousedown', () => { | |
chrome.runtime.sendMessage({ action: 'test' }, reply => { | |
console.log('got a reply'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"manifest_version": 2, | |
"name": "Chrome message test", | |
"version": "0.1", | |
"content_scripts": [ | |
{ | |
"all_frames": true, | |
"js": [ | |
"content-script.js" | |
], | |
"matches": [ | |
"http://*/*", | |
"https://*/*" | |
], | |
"exclude_matches": [ | |
"*://*/_/chrome/newtab*" | |
], | |
"run_at": "document_start" | |
} | |
], | |
"permissions": [ | |
"http://*/*", | |
"https://*/*" | |
], | |
"background": { | |
"scripts": [ | |
"background.js" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment