summaryrefslogtreecommitdiffstats
path: root/addon-sdk/source/test/addons/embedded-webextension/webextension/background-page.js
blob: 05e7a613b57e34604801c191375bd53b96ac4a11 (plain)
1
2
3
4
5
6
7
8
9
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");