Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6064d14d259b584794c5fc03c1ea41d38cafd98e
      
https://github.com/WebKit/WebKit/commit/6064d14d259b584794c5fc03c1ea41d38cafd98e
  Author: Brian Weinstein <[email protected]>
  Date:   2024-11-08 (Fri, 08 Nov 2024)

  Changed paths:
    M 
Source/WebKit/UIProcess/Extensions/Cocoa/_WKWebExtensionDeclarativeNetRequestRule.mm
    M 
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIDeclarativeNetRequest.mm

  Log Message:
  -----------
  Correctly convert DNR rules with both initiatorDomains and 
excludedInitiatorDomains
https://bugs.webkit.org/show_bug.cgi?id=282845
rdar://139515419

Reviewed by Timothy Hatcher.

If a rule has both initiatorDomains and excludedInitiatorDomains, we should 
convert it into 2 rules:
1) An ignore-previous-rules rule with the excludedInitiatorDomains being 
converted into the
if-frame-url of the trigger
2) The rule itself with the excludedInitiatorDomains omitted (since they are 
handled by the first
rule).

This PR also adds a test to make sure that the rule is converted correctly.

* 
Source/WebKit/UIProcess/Extensions/Cocoa/_WKWebExtensionDeclarativeNetRequestRule.mm:
(-[_WKWebExtensionDeclarativeNetRequestRule ruleInWebKitFormat]):
(-[_WKWebExtensionDeclarativeNetRequestRule 
_webKitRuleWithWebKitActionType:chromeActionType:chromeResourceTypes:]):
* 
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIDeclarativeNetRequest.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIDeclarativeNetRequest, 
RuleConversionWithExcludedInitiatorDomainsAndInitiatorDomains)):

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



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

Reply via email to