[webkit-changes] [WebKit/WebKit] b09450: DNR content rule list notifications aren't being d...

Brian Weinstein noreply at github.com
Fri Dec 8 15:35:19 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b09450296bb71cd5a926c1b63b72fbea324a9a70
      https://github.com/WebKit/WebKit/commit/b09450296bb71cd5a926c1b63b72fbea324a9a70
  Author: Brian Weinstein <bweinstein at apple.com>
  Date:   2023-12-08 (Fri, 08 Dec 2023)

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

  Log Message:
  -----------
  DNR content rule list notifications aren't being delivered to the correct extension
https://bugs.webkit.org/show_bug.cgi?id=266099
<rdar://problem/119397749>

Reviewed by Timothy Hatcher.

When notifying an extension that a DNR rule was matched (for getMatchedRules or setExtensionActionOptions), we need a way
to match the content rule list notification to the extension. After the change of the name of the content rule list to be the
same across all extensions, there was no way to do this anymore.

It's a bit silly to require the unique name of the extension in an already unique directory, but ContentRuleListResults only
has the identifier of the content rule list that performed the action, not the store it came from.

While I'm here, a few more changes were made:
1) Clear out some DNR ivars when an extension context is unloaded
2) Enhance the DynamicRules test to unload and reload the extension context, and verify that the rules are still loaded and applied
upon unload/reload of the context.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::unload):
(WebKit::WebExtensionContext::addDeclarativeNetRequestRulesToPrivateUserContentControllers):
(WebKit::WebExtensionContext::compileDeclarativeNetRequestRules):
(WebKit::WebExtensionContext::loadDeclarativeNetRequestRules):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIDeclarativeNetRequest.mm:
(TestWebKitAPI::TEST):

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




More information about the webkit-changes mailing list