How to sendToBackground from main world
i've try all of messaging method but background still not receive anything
6 Replies
Were you able to get it working?
yeah
For me i am sending msg from main world using sendToBackgroundViaRelay, then i receive that message in content script which is not in main world, then i use sendToBackground which sends that message to background service from content script.
When my middle content script receives the response i use window.postMessage which sends the response to main world, so basically i have to use a content script in middle as a relayer of messages, to and from main and bg
Are you using something similar or have you found a way to directly communicate between main world and bgsw?
mine using similar method
using sendToBackgroundViaRelay from main world and use relayMessage on content to send it to bgsw
Ok, thanks for confirming π
ππ»