Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6456b7a8d82c9e9cb7bda7c0034ae45dce27e567
      
https://github.com/WebKit/WebKit/commit/6456b7a8d82c9e9cb7bda7c0034ae45dce27e567
  Author: Brian Weinstein <[email protected]>
  Date:   2026-10-01 (Thu, 01 Oct 2026)

  Changed paths:
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WebCore/page/csp/ContentSecurityPolicy.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIPermissions.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebView.cpp
    M Tools/WebKitTestRunner/TestOptions.cpp

  Log Message:
  -----------
  HTTP family iframes loaded inside a Web Extension main frame have incorrect 
CSP
https://bugs.webkit.org/show_bug.cgi?id=325813
rdar://188407446

Reviewed by Timothy Hatcher, Kiara Rose, and Charlie Wolfe.

We should be only setting m_contentSecurityPolicyModeForExtension if the scheme 
is one that
is meant to bypass the default content security policy.

We also need to add a way to bypass this scheme check when running LayoutTests, 
because they
mimic extension CSP in the HTTP protocol. To do this, we add a new web 
preference that is
only turned on for running layout tests (both for WebKitTestRunner and the GTK 
port).

Tests: 
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIPermissions.mm
       Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebView.cpp

* Source/WebCore/page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::copyStateFrom):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIPermissions.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIPermissions, 
CSPExtensionModeNotAppliedToWebPageSubframe)):
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Tools/WebKitTestRunner/TestOptions.cpp:
(WTR::TestOptions::defaults):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebView.cpp:
(testWebViewWebExtensionMode):

Canonical link: https://commits.webkit.org/322449@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to