My website and extension are cooperating in such a way that I need to send a message from my website (not content-script) to my background script. In Chrome, this could be achieved via
window.chrome.runtime.sendMessage(
EXTENSION_ID,
{
// some message
}
);
and then in manifest.json
I declare the externally_connectable
attribute, which is not supported by Firefox.
There doesn’t seem to be a way to do this with WebExtensions.
- https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/onMessage
- https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts
Any advice from anyone?