Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8e4d67498529fe734333c13a5bcd481305a0c321
https://github.com/WebKit/WebKit/commit/8e4d67498529fe734333c13a5bcd481305a0c321
Author: Elijah Sawyers <[email protected]>
Date: 2026-09-14 (Mon, 14 Sep 2026)
Changed paths:
M Source/WebKit/Shared/ResourceLoadInfo.h
M Source/WebKit/Shared/ResourceLoadInfo.serialization.in
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
M Source/WebKit/UIProcess/WebPageProxy.cpp
M
Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWebRequestCocoa.mm
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIWebRequest.mm
Log Message:
-----------
webRequest reports the wrong parentFrameId for a first-level subframe
https://bugs.webkit.org/show_bug.cgi?id=323993
rdar://187227773
Reviewed by Timothy Hatcher.
This patch makes webRequest report parentFrameId as 0 for a subframe whose
parent is the main
frame, matching other browsers. The webRequest details are built in the
WebProcess from raw
WebCore frame identifiers it cannot resolve, so a main frame appearing as a
parent was emitted
as its raw identifier instead of 0. ResourceLoadInfo now carries whether the
parent is the
main frame, populated in the UIProcess where the frame tree is available (for
both ordinary
loads and declarativeNetRequest-blocked loads), and the details map that to 0.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIWebRequest.mm
* Source/WebKit/Shared/ResourceLoadInfo.h:
* Source/WebKit/Shared/ResourceLoadInfo.serialization.in:
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::resourceLoadWasBlockedByDeclarativeNetRequest):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::isParentFrameMainFrame):
(WebKit::WebPageProxy::resourceLoadDidSendRequest):
(WebKit::WebPageProxy::resourceLoadDidPerformHTTPRedirection):
(WebKit::WebPageProxy::resourceLoadDidReceiveChallenge):
(WebKit::WebPageProxy::resourceLoadDidReceiveResponse):
(WebKit::WebPageProxy::resourceLoadDidCompleteWithError):
*
Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWebRequestCocoa.mm:
(WebKit::webRequestDetailsForResourceLoad):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIWebRequest.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIWebRequest,
BeforeRequestEventSubframeParentFrameIsMainFrame)):
(TestWebKitAPI::TEST(WKWebExtensionAPIWebRequest,
BeforeRequestEventNestedSubframeParentFrameId)):
(TestWebKitAPI::TEST(WKWebExtensionAPIWebRequest,
WebRequestParentFrameIdForDeclarativeNetRequestBlockedSubframe)):
Canonical link: https://commits.webkit.org/321079@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications