Minimal Webextension to reproduce chrome messaging issue on Chrome 71. Test site: http://jsfiddle.net/jqwidgets/6q7h9xcj/
| chrome.runtime.onMessage.addListener((message, sender, respond) => { | |
| console.log('got message', message); | |
| respond({ action: 'reply' }); | |
| }); |
| window.addEventListener('mousedown', () => { | |
| chrome.runtime.sendMessage({ action: 'test' }, reply => { | |
| console.log('got a reply'); | |
| }); | |
| }); |
| { | |
| "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