[webkit-changes] [WebKit/WebKit] 7a3236: Context menu items for Action and Tab are not filt...

Timothy Hatcher noreply at github.com
Mon Mar 4 10:28:18 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7a3236ba274c5374337531088e431b1ce8728a77
      https://github.com/WebKit/WebKit/commit/7a3236ba274c5374337531088e431b1ce8728a77
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-03-04 (Mon, 04 Mar 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
    M Source/WebKit/UIProcess/Extensions/WebExtensionMenuItem.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIMenus.mm

  Log Message:
  -----------
  Context menu items for Action and Tab are not filtered by tab URL.
https://webkit.org/b/270420
rdar://123977080

Reviewed by Brian Weinstein.

Allow documentUrlPatterns to apply to action and tab context for menus. This prevents
menu items from appearing that don’t apply to the current document in the tab.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm:
(WebKit::WebExtensionAction::platformMenuItems const): Set frameURL.
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::platformMenuItems const): Set frameURL.
* Source/WebKit/UIProcess/Extensions/WebExtensionMenuItem.cpp:
(WebKit::WebExtensionMenuItem::matches const): Match frameURL before the early
return for action and tab contexts. Only match if frameURL is non-null.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIMenus.mm:
(TEST(WKWebExtensionAPIMenus, ActionMenus)): Added documentUrlPatterns to one item.
(TEST(WKWebExtensionAPIMenus, TabMenus)): Ditto.

Canonical link: https://commits.webkit.org/275638@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