diff options
Diffstat (limited to 'addon-sdk/source/test/addons/embedded-webextension/webextension/content-script.js')
-rw-r--r-- | addon-sdk/source/test/addons/embedded-webextension/webextension/content-script.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/addon-sdk/source/test/addons/embedded-webextension/webextension/content-script.js b/addon-sdk/source/test/addons/embedded-webextension/webextension/content-script.js new file mode 100644 index 000000000..a8770e623 --- /dev/null +++ b/addon-sdk/source/test/addons/embedded-webextension/webextension/content-script.js @@ -0,0 +1,10 @@ +browser.runtime.sendMessage("content script->sdk message", (reply) => { + browser.runtime.sendMessage(reply); +}); + +let port = browser.runtime.connect(); +port.onMessage.addListener((msg) => { + port.postMessage(`content script received ${msg}`); + port.disconnect(); +}); +port.postMessage("content script->sdk port message"); |