WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 218086
221283
iframe sandbox prevents extension script event listeners
https://bugs.webkit.org/show_bug.cgi?id=221283
Summary
iframe sandbox prevents extension script event listeners
Jeff Johnson
Reported
2021-02-02 12:37:56 PST
Created
attachment 419048
[details]
Example html document Overview: If an iframe has the sandbox attribute without allow-script, then Safari web extension event listeners won't get called in the iframe. This is contrary to Google Chrome, which does allow extension event listeners in a sandbox iframe. Moreover, Content-Security-Policy script-src 'none' also still allows extension event listeners. So iframe sandbox should only prevent web page script, not extension script. Steps to Reproduce: 1. Put the attached "index.html" document in /Users/Shared (to avoid Mac TCC issues) 2. cd /Users/Shared 3. /usr/bin/python -m SimpleHTTPServer 8000 4. Build and run the attached sample Xcode project "SandboxTest" 5. Open Safari 6. Select "Allow Unsigned Extensions" from the Develop menu. 7. Open Safari Preferences Extensions pane. 8. Enable the SandboxTest extension. 9. Select "Always Allow on Every Website..." 10. Open
http://localhost:8000
11. Open the web inspector console 12. Click inside the sandbox iframe Actual Results: [Error] Blocked script execution in '
https://example.org/
' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. Expected Results: [Log] SandboxTest mousedown: – "H1" (content.js, line 7) Additional Information: This bug also affects Safari app extensions and affects Safari 14 on Catalina and Mojave on Intel Macs.
Attachments
Example html document
(582 bytes, text/html)
2021-02-02 12:37 PST
,
Jeff Johnson
no flags
Details
Sample Xcode project
(215.74 KB, application/zip)
2021-02-02 12:38 PST
,
Jeff Johnson
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Jeff Johnson
Comment 1
2021-02-02 12:38:25 PST
Created
attachment 419049
[details]
Sample Xcode project
Jeff Johnson
Comment 2
2021-02-02 12:44:15 PST
You can see from the console log that the extension content script itself does get run in the sandbox iframe. So it's just the script's event listener that doesn't get called.
Radar WebKit Bug Importer
Comment 3
2021-02-02 14:22:13 PST
<
rdar://problem/73898565
>
Smoley
Comment 4
2021-02-05 18:06:30 PST
*** This bug has been marked as a duplicate of
bug 218086
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug