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
The text was updated successfully, but these errors were encountered:
fregante
changed the title
Implement web page -> background script communication, with Firefox
Implement web page -> background script communication, with Firefox polyfill
Aug 22, 2021
A few notes regarding the unsafe communication in general:
This API will need to accept an extension ID (for externally_connectable), which could be defined in getMethod("GET_VERSION", id) (since it's static) or at the call site, so getVersion(id)
The unsafe context should probably not have access to arbitrary tabs or contexts, so getVersion({extensionId, tabId, frameId}) should not be supported
Since this is now being built as a public module, the unsafe messaging should probably always indicate which extension it's trying to talk to, even if the content script doesn't require the extension ID.
This leaves only 3 contexts accessible from the unsafe context:
current CS
background context (either via externally_connectable or via CS)
perhaps the current tab’s editor/devtools (either directly or via CS+background)
Since the unsafe context is special, security-wise, it should probably have its own special methods for each context anyway.
I agree with everything above. As you mention, the external -> devtools isn't strictly necessary because it can hop through the background page. (I don't think CS can initiate communication to the devtools in our current setup?)
Also commented in #5 (comment) about opt-in for endpoints
externally_connectible
in Firefox) pixiebrix-extension#1015externalProtocol
messaging pixiebrix-extension#1019The text was updated successfully, but these errors were encountered: