Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c74275db2db57b94d310fd4f616538dc8f76191d
      
https://github.com/WebKit/WebKit/commit/c74275db2db57b94d310fd4f616538dc8f76191d
  Author: Kiara Rose <kiara_r...@apple.com>
  Date:   2025-08-26 (Tue, 26 Aug 2025)

  Changed paths:
    M Source/WebCore/contentextensions/ContentExtensionActions.cpp
    M Source/WebCore/contentextensions/ContentExtensionActions.h
    M Source/WebCore/contentextensions/ContentExtensionsBackend.cpp
    M Source/WebCore/contentextensions/ContentExtensionsBackend.h
    M Source/WebCore/loader/PolicyChecker.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentExtensionStore.mm

  Log Message:
  -----------
  [uBlock Origin Lite] Web page crashes with URL Tracking Filter list enabled
https://bugs.webkit.org/show_bug.cgi?id=297554
rdar://158180410

Reviewed by Brian Weinstein.

Similar to https://webkit.org/b/297077, the web content process was crashing 
after performing an
extension redirect rule in PolicyChecker. Unlike bug 297077, the resource 
request was actually
being modified with a query transform rule. However, I was seeing the same 
error message about an
invalid WebPageProxy_DidStartProvisionalLoadForFrame message being sent so I 
think this bug was
hitting the same issue.

To address this, build on the fix for bug 297077 by only applying redirects 
rule for cross origin
redirects, since this was the only reason why this code was added. Since this 
is the second bug we've
hit with this code, I think investigating https://webkit.org/b/297553 is an 
appropriate follow up
if we see more bugs caused by applying the content blocking redirect rules 
before we decide the
policy for the navigation.

Testing:
- Added a test to verify the fix.
- Verified all WKContentExtensionStoreTests passed.

* Source/WebCore/contentextensions/ContentExtensionActions.cpp:
(WebCore::ContentExtensions::RedirectAction::applyToRequest):
Use new helper method to modify the url.

(WebCore::ContentExtensions::RedirectAction::modifyURL):
Added new helper to modify the url when applying RedirectActions.

* Source/WebCore/contentextensions/ContentExtensionActions.h:
* Source/WebCore/contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::applyResultsToRequestIfCrossOriginRedirect):
Only modifies the request if a cross origin redirect will occur.

(WebCore::ContentExtensions::applyResultsToRequest):
Update method to take a redirect URL.

* Source/WebCore/contentextensions/ContentExtensionsBackend.h:
(WebCore::ContentExtensions::applyResultsToRequest):
If a redirectURL is passed, set the request URL to the redirect URL. Otherwise, 
call applyToRequest
to generate and apply the redirect URL.

* Source/WebCore/loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
Only apply the rules for cross origin redirects.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentExtensionStore.mm:
(TEST_F(WKContentRuleListStoreTest, MainResourceSameOriginRedirect)):
Verifies that the page loads after a same origin redirect

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to