How to sendToBackground from main world

i've try all of messaging method but background still not receive anything
6 Replies
Saqlain
Saqlain9mo ago
Were you able to get it working?
noxzym
noxzymOP9mo ago
yeah
Saqlain
Saqlain9mo ago
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?
noxzym
noxzymOP9mo ago
mine using similar method using sendToBackgroundViaRelay from main world and use relayMessage on content to send it to bgsw
Saqlain
Saqlain9mo ago
Ok, thanks for confirming 👍
noxzym
noxzymOP9mo ago
👍🏻

Did you find this page helpful?