You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to request some info from our extesnion on our website and want to make it cross-browser, but when I tried using this polyfill to make the messaging work in all supported browsers and it works great for communication inside the extension. But when I try to use it on the web page I get Uncaught Error: This script should only be loaded in a browser extension. and that's really because making this to work in all browsers will be rather difficult.
I saw there's a typeof globalThis != "object" || typeof chrome != "object" || !chrome || !chrome.runtime || !chrome.runtime.id check and the only check web page does not pass is the chrome.runtime.id obviously because it's not an extension. But can I ask what is the motivation for not allowing this polyfill work on web pages as well?
Is there a way to make this work?
The text was updated successfully, but these errors were encountered:
We need to request some info from our extesnion on our website and want to make it cross-browser, but when I tried using this polyfill to make the messaging work in all supported browsers and it works great for communication inside the extension. But when I try to use it on the web page I get
Uncaught Error: This script should only be loaded in a browser extension.
and that's really because making this to work in all browsers will be rather difficult.I saw there's a
typeof globalThis != "object" || typeof chrome != "object" || !chrome || !chrome.runtime || !chrome.runtime.id
check and the only check web page does not pass is thechrome.runtime.id
obviously because it's not an extension. But can I ask what is the motivation for not allowing this polyfill work on web pages as well?Is there a way to make this work?
The text was updated successfully, but these errors were encountered: