Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 233543e905fb5a340d4d9d76180bfb46c5852a30
      
https://github.com/WebKit/WebKit/commit/233543e905fb5a340d4d9d76180bfb46c5852a30
  Author: Anthony Tarbinian <[email protected]>
  Date:   2026-04-23 (Thu, 23 Apr 2026)

  Changed paths:
    M LayoutTests/platform/ios-site-isolation/TestExpectations
    M LayoutTests/platform/mac-site-isolation/TestExpectations
    A Tools/WebKitTestRunner/ExternalURLBlockingHelpers.h
    M Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
    M Tools/WebKitTestRunner/TestController.cpp
    M Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj

  Log Message:
  -----------
  [Site Isolation] Add WKTR external site blocking outside InjectedBundle
https://bugs.webkit.org/show_bug.cgi?id=312206
rdar://174695731

Reviewed by Sihui Liu.

With site isolation enabled, fast/dom/window-load-crash.html is missing
"Blocked access to external URL..." console message when it tries to
navigate a frame to an external URL which is normally blocked by 
WebKitTestRunner.

Pre site-isolation, this code lives in 
InjectedBundlePage::willSendRequestForFrame.
However since in site isolation, the jsContext of a RemoteFrame is null and we
return early before this message gets logged since we can't use JSEvaluateScript
with a null jsContext.

Instead, move this code to the UIProcess in 
TestController::decidePolicyForNavigation
and move shared functionality from InjectedBundlePage::willSendRequestForFrame 
to a common place.

This patch fixes fast/dom/window-load-crash.html with site isolation enabled.

* LayoutTests/platform/ios-site-isolation/TestExpectations:
* LayoutTests/platform/mac-site-isolation/TestExpectations:
* Tools/WebKitTestRunner/ExternalURLBlockingHelpers.h: Added.
(WTR::isLocalHost):
(WTR::isHTTPOrHTTPSScheme):
(WTR::isExternalURLBlockable):
(WTR::isMainFrameURLExternal):
(WTR::sanitizeExternalURL):
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::willSendRequestForFrame):
(WTR::isLocalHost): Deleted.
(WTR::isHTTPOrHTTPSScheme): Deleted.
* Tools/WebKitTestRunner/TestController.cpp:
* Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:

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



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

Reply via email to