PlasmoHQ / docs

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

Feedback for “Messaging API” #138

Open cdaringe opened 4 hours ago

cdaringe commented 4 hours 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 4 hours ago

I eventually downgraded to:

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

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