PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.31k stars 358 forks source link

[BUG] sendToBackground don't work in “MAIN” content #1003

Closed Half-A-Turnip closed 3 months ago

Half-A-Turnip commented 3 months ago

What happened?

sendToBackground don't work when config.world is "MAIN"

Version

Latest

What OS are you seeing the problem on?

No response

What browsers are you seeing the problem on?

No response

Relevant log output

No response

(OPTIONAL) Contribution

Code of Conduct

songxiaocheng commented 3 months ago

A duplicate of #823.

A workaround is to use sendToBackgroundViaRelay in the "MAIN" content script, as suggested by @naan.

Simply create an "ISOLATED" content script with a relayMessage call. More details can be found here.