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

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

  Log Message:
  -----------
  webRequest reports main_frame instead of sub_frame for subframe document loads
https://bugs.webkit.org/show_bug.cgi?id=304828
rdar://167403388

Reviewed by Timothy Hatcher.

This patch makes webRequest report the sub_frame resource type for subframe 
document
loads. The details.type value came from ResourceLoadInfo::Type, whose single 
Document
case is shared by both top-level and iframe navigations, so every document load 
was
reported as main_frame. A subframe document load carries a parentFrameID, the 
same signal
the details already use to distinguish frameId and parentFrameId, so the type 
is now
sub_frame when a Document load has a parent frame.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIWebRequest.mm
* 
Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWebRequestCocoa.mm:
(WebKit::webRequestDetailsForResourceLoad):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIWebRequest.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIWebRequest, 
BeforeRequestEventForSubframe)):

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



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

Reply via email to