AboutSupportDeveloper GuideVersion 22.3.18

Interface PageTabContextMenuItemTemplate

Configuration of an option in the page tab context menu

interface PageTabContextMenuItemTemplate {
    checked?: boolean;
    data?: PageTabContextMenuItemData;
    enabled?: boolean;
    icon?: string;
    label?: string;
    role?:
        | "cut"
        | "copy"
        | "paste"
        | "toggleDevTools"
        | "reload";
    submenu?: MenuItemTemplate<unknown>[];
    type?:
        | "normal"
        | "separator"
        | "submenu"
        | "checkbox";
    visible?: boolean;
}

Hierarchy

  • MenuItemTemplate
    • PageTabContextMenuItemTemplate

Properties

checked?: boolean

Should only be specified for checkbox type menu items.

Data to be returned if the user selects the element. Must be serializable

enabled?: boolean

If false, the menu item will be greyed out and unclickable.

icon?: string

Image Data URI with image dimensions inferred from the encoded string

label?: string

The text to show on the menu item. Should be left undefined for type: 'separator'

role?:
    | "cut"
    | "copy"
    | "paste"
    | "toggleDevTools"
    | "reload"
submenu?: MenuItemTemplate<unknown>[]

Should be specified for submenu type menu items. If submenu is specified, the type: 'submenu' can be omitted.

type?:
    | "normal"
    | "separator"
    | "submenu"
    | "checkbox"

Can be normal, separator, submenu, or checkbox. Defaults to 'normal' unless a 'submenu' key exists

visible?: boolean

If false, the menu item will be entirely hidden.