crx-bridge
crx-bridge copied to clipboard
Unable to detect runtime context i.e crx-bridge can't figure out what to do
In my MV3 extension, I've tried to send a dummy message from a content script to the background service worker and I get the following error from the extension
Uncaught Error: Unable to detect runtime context i.e crx-bridge can't figure out what to do
which seems to me that it can't even find the background "namespace". I'm not using the "window" so wouldn't that work out of the box?
P.S Thanks for this excellent package!
Workers of any kind are not supported at this point.
Load crx-bridge
in the background script as usual, then leverage v-thread
to create the workers. Proxy the function calls through it.
v-thread
is not a popular package. Perhaps workers itself are not as common as I think they are, or I just didn't use proper keywords. But if you spot any problems or questions, do create the issue in the repo.
Perhaps I didn't explain the issue clearly (or I don't understand the reply). I get the error just by loading the background service worker. I don't want to create any workers there.
In chrome extensions with Manifest Version 3 (MV3), the background script is replaced by a background service worker.
same issue
This should be fixed in [email protected]
, the successor to crx-bridge