You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have an extension with html files added to web_accessible_resources in the manifest. These pages should be allowed to communicate with the background script and other pages, similarly to how for e.g. the popup page can communicate with the background script.
The problem
webext-bridge currently does not treat these pages from web_accessible_resources as different contexts, rather it detects them as background contexts. This prevents them to communicate with the background script, even through there is no security risk here, as the browser.runtime.sendMessage/browser.runtime.onMessage APIs are already exposed to them.
Potential solution
Create a new type of context (e.g.: web_accessible) that behaves similarly to how the content-script contexts work. There could be multiple pages added to web_accessible_resources, so this would allow you to send messages to specific pages as well, using their tabId.
Example
Send a message to a page with "web_accessible" context and the tabId 3412:
Usecase
You have an extension with html files added to
web_accessible_resources
in the manifest. These pages should be allowed to communicate with the background script and other pages, similarly to how for e.g. thepopup
page can communicate with the background script.The problem
webext-bridge
currently does not treat these pages fromweb_accessible_resources
as different contexts, rather it detects them asbackground
contexts. This prevents them to communicate with the background script, even through there is no security risk here, as thebrowser.runtime.sendMessage
/browser.runtime.onMessage
APIs are already exposed to them.Potential solution
Create a new type of context (e.g.:
web_accessible
) that behaves similarly to how thecontent-script
contexts work. There could be multiple pages added toweb_accessible_resources
, so this would allow you to send messages to specific pages as well, using theirtabId
.Example
Send a message to a page with "
web_accessible
" context and the tabId3412
:The text was updated successfully, but these errors were encountered: