-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
We have tabId: "this" for this purpose:
however it only works between extension pages because:
-
only extension pages can use chrome.tab without intermediary steps
-
the current logic only handles
"this"by comparing the sender to the current context, but this could be trivially changed:on send: if isContentScript && tabId === "this" send to background on background receive: if tabId === "this" forward to this.trace[0].tab.id
webext-messenger/source/thisTarget.ts
Lines 68 to 71 in ed302a0
// Set "this" tab to the current tabId if (to.tabId === "this" && thisTarget.tabId === from.tab?.id) { to.tabId = thisTarget.tabId; }
Metadata
Metadata
Assignees
Labels
No labels