-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: match_origin_as_fallback
failing to fix content script injection into iframes with sandbox
and srcdoc
attrs
#8927
Comments
We modified the linked manifest.json (https://github.com/pixiebrix/pixiebrix-extension/blob/main/src/manifest.json changed added: Running our extension on the test page then produces this error in the console:
Followed immediately by this log:
If I modify the iframe sandbox attribute to I posted this on the chrome issue to see what else we can do. https://issues.chromium.org/issues/355256366 |
Another dev reported this: [email protected], adding match_origin_as_fallback works for me in a local copy of PixieBrix from the web store loaded as an unpacked extension. I see PixieBrix in devtools console context switcher under both about:srcdoc frames as well as 3 messages about setRuntimeLogging. |
re
I am able to confirm that the content script is loaded in srcdoc + sandbox iframes, but the initialization logic is failing to execute with the following error:
Via logging (I can't set breakpoints directly inside the offending iframes), I am able to narrow down the issue to something going wrong in this promise:
|
@mnholtz it's likely due to how dynamic imports work. We use https://github.com/awesome-webextension/webpack-target-webextension which might be using script tags to inject the modules at runtime |
We have resolved this by modifying the hack to look for these iframe and remove the sandbox attribute. We also hid this behind the "iframe-srcdoc-sandbox-hack" flag. As a follow-up we have this issue to remove this hack once the related chromium issues are resolved: |
This issue will be closed in 7 days unless the stale label is removed, or a comment is added to the issue. |
Follow-up to #8922
We've identified setting
match_origin_as_fallback
in the manifest as a preferred approach to fixing #8921But neither @fungairino nor @mnholtz were able to replicate a fix locally with the PixieBrix Extension, despite being able to reproduce the fix with a simple reproduction detailed in https://issues.chromium.org/issues/355256366
This implies that there must be something specific to the new version of Chrome and the PixieBrix extension that is preventing the content script injection with these sort of iframes
<iframe srcdoc="..." sandbox/>
The text was updated successfully, but these errors were encountered: