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