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