Contents

menuItems(for:)

Retrieves the menu items for a given tab.

Declaration

func menuItems(for tab: any WKWebExtensionTab) -> [UIMenuElement]
func menuItems(for tab: any WKWebExtensionTab) -> [NSMenuItem]

Parameters

  • tab:

    The tab for which to retrieve the menu items.

Discussion

Returns menu items provided by the extension, allowing the user to perform extension-defined actions on the tab.

The app is responsible for displaying these menu items, typically in a context menu or a long-press menu on the tab.