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
Let's migrate the rest (search for injectScript in the MV3 branch).
The main problem with window.injectScript() is that it is subject to page CSPs. This means learning from canvas fingerprinting and local storage is broken on sites with restrictive CSPs (like this very site probably). We pollute the page dev tools console and/or the Errors button on chrome://extensions/ when this happens.
ghostwords
changed the title
Switch remaining CSP-vulnerable dynamic main world injection to scripting API
Switch remaining CSP-vulnerable main world script injection to scripting API
Feb 6, 2025
One issue is that the two remaining uses of injectScript() both pass a parameter to the main world script, so that the main world script can send messages back to the content script using CustomEvents with a prearranged, random ID, to make message interception a bit harder.
Edit: There are now two relevant API proposals, dom.execute() (synchronous cross-world content script injection) and dom.createPort() (secure communication).
We already migrated most but not all uses of
window.injectScript()
to thescripting
API:Let's migrate the rest (search for
injectScript
in the MV3 branch).The main problem with
window.injectScript()
is that it is subject to page CSPs. This means learning from canvas fingerprinting and local storage is broken on sites with restrictive CSPs (like this very site probably). We pollute the page dev tools console and/or the Errors button onchrome://extensions/
when this happens.Related issues: #1793, #1865
The text was updated successfully, but these errors were encountered: