Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8a7c9496defd751dc5508aa3e9de7b3158d7a5bd
      
https://github.com/WebKit/WebKit/commit/8a7c9496defd751dc5508aa3e9de7b3158d7a5bd
  Author: Elijah Sawyers <[email protected]>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    M 
Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIWebRequest.mm

  Log Message:
  -----------
  webRequest main_frame and sub_frame type filters are swapped
https://bugs.webkit.org/show_bug.cgi?id=323979
rdar://187214709

Reviewed by Timothy Hatcher.

This patch fixes the resource type used to match webRequest listeners against 
their types
filter. A Document load was classified as main_frame when it had a parent frame 
and sub_frame
when it did not, which is reversed: a types:['sub_frame'] listener matched the 
top-level
navigation and missed iframes, while a types:['main_frame'] listener matched 
iframes. A
Document load with a parentFrameID is a subframe, so it now classifies as 
sub_frame, and one
without a parent as main_frame.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIWebRequest.mm
* Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:
(toWebExtensionWebRequestResourceType):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIWebRequest.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIWebRequest, 
BeforeRequestEventSubframeTypeFilter)):

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



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

Reply via email to