Add sandbox attribute to extension iframe in DevTools. - #9967
Conversation
This change grants these permissions: - `allow-scripts`: enables extension JS / Wasm execution. - `allow-forms`: permits standard form interactions. - `allow-downloads`: allows extensions to export files/logs. - `allow-popups` & `allow-popups-to-escape-sandbox`: allows opening external links. This does not grant `allow-same-origin` permission, so extensions can't access the parent window's DOM, cookies, or local storage.
There was a problem hiding this comment.
Code Review
This pull request introduces iframe sandboxing for embedded DevTools extensions to enforce origin isolation, and updates the release notes. The reviewer recommended extracting the raw sandbox configuration string into a descriptive named constant to avoid magic strings, in accordance with the repository style guide.
|
Does this fix a specific issue that's been opened? |
|
See b/535724008 |
kenzieschmoll
left a comment
There was a problem hiding this comment.
How was this tested? The iFrame does need to talk back and forth with the parent for the DevTools extension API, so just want to make sure everything here still works.
|
This should still allow |
Flutter Web extensions require same-origin access for flutter.js to initialize Service Workers and web storage without throwing a SecurityError. This is still secure because the extension must be enabled, and the sandbox prevents top-level navigation, popups, and modal hijacking.
|
I ran a more complete test on the These headers still prevent extensions from page-hijacking, displaying popups, etc, so this is still a good thing to do. |
This change grants these permissions:
allow-scripts: enables extension JS / Wasm execution.allow-forms: permits standard form interactions.allow-downloads: allows extensions to export files/logs.allow-popups&allow-popups-to-escape-sandbox: allows opening external links.This does not grant
allow-same-originpermission, so extensions can't access the parent window's DOM, cookies, or local storage.