[webkit-changes] [WebKit/WebKit] 9a753f: Don't return early from populateCommandsIfNeeded i...

Brian Weinstein noreply at github.com
Wed Sep 4 20:44:43 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9a753fd3e08746a0158839beeb86738c51e3d5f8
      https://github.com/WebKit/WebKit/commit/9a753fd3e08746a0158839beeb86738c51e3d5f8
  Author: Brian Weinstein <bweinstein at apple.com>
  Date:   2024-09-04 (Wed, 04 Sep 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCommandCocoa.mm
    M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPINamespaceCocoa.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtension.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPICommands.mm

  Log Message:
  -----------
  Don't return early from populateCommandsIfNeeded if the dictionary is empty
https://bugs.webkit.org/show_bug.cgi?id=279164
rdar://135279505

Reviewed by Timothy Hatcher.

If an extension specifies an empty "commands" manifest entry (or no entry at all), we still want to give it an `_execute_*_action` command. This PR
makes that change and adds a test.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm:
(WebKit::WebExtension::populateCommandsIfNeeded): Only return early if the commands entry is malformed, not just if it's empty.
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCommandCocoa.mm:
(WebKit::WebExtensionCommand::setActivationKey): Add comments for what these values represent.
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPINamespaceCocoa.mm:
(WebKit::WebExtensionAPINamespace::isPropertyAllowed): Consider an empty dictionary entry non-nil.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPICommands.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPICommands, GetAllCommandsEmptyManifest)):

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



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


More information about the webkit-changes mailing list