Information sent when a context menu item is clicked.

interface OnClickData {
    bookmarkId?: string;
    button?: number;
    checked?: boolean;
    editable: boolean;
    frameId?: number;
    frameUrl?: string;
    linkText?: string;
    linkUrl?: string;
    mediaType?: string;
    menuItemId: string | number;
    modifiers: browser.contextMenus._OnClickDataModifiers[];
    pageUrl?: string;
    parentMenuItemId?: string | number;
    selectionText?: string;
    srcUrl?: string;
    targetElementId?: number;
    viewType?: ViewType;
    wasChecked?: boolean;
}
Index
bookmarkId?: string

The id of the bookmark where the context menu was clicked, if it was on a bookmark.

button?: number

An integer value of button by which menu item was clicked.

checked?: boolean

A flag indicating the state of a checkbox or radio item after it is clicked.

editable: boolean

A flag indicating whether the element is editable (text input, textarea, etc.).

frameId?: number

The id of the frame of the element where the context menu was clicked.

frameUrl?: string

The URL of the frame of the element where the context menu was clicked, if it was in a frame.

linkText?: string

If the element is a link, the text of that link.

linkUrl?: string

If the element is a link, the URL it points to.

mediaType?: string

One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements.

menuItemId: string | number

The ID of the menu item that was clicked.

An array of keyboard modifiers that were held while the menu item was clicked.

pageUrl?: string

The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu.

parentMenuItemId?: string | number

The parent ID, if any, for the item clicked.

selectionText?: string

The text for the context selection, if any.

srcUrl?: string

Will be present for elements with a 'src' URL.

targetElementId?: number

An identifier of the clicked element, if any. Use menus.getTargetElement in the page to find the corresponding element.

viewType?: ViewType

The type of view where the menu is clicked. May be unset if the menu is not associated with a view.

wasChecked?: boolean

A flag indicating the state of a checkbox or radio item before it was clicked.