PlasmoHQ / docs

📘 Documentation site
https://docs.plasmo.com
12 stars 50 forks source link

Feedback for “Messaging API” #138

Open cdaringe opened 2 weeks ago

cdaringe commented 2 weeks ago

Problem statement

My background script must eventually push a message to my content-script, however, the messaging docs don't clearly articulate the pattern. The table suggests "Port + Relay" is the solution, but a recipe is not offered for pushing messages from bgsw to content, only req/res style with ports/relays.

cdaringe commented 2 weeks ago

I eventually downgraded to:

      await browser.tabs.sendMessage(details.tabId, { type: "FOO", data });

which is untyped, has no fancy react hooks, etc.