contextMenus.OnClickData

Information sent when a context menu item is clicked.

Type

Values of this type are objects. They contain the following properties:

menuItemId
integer or string. The ID of the menu item that was clicked.
parentMenuItemIdOptional
integer or string. The parent ID, if any, for the item clicked.
mediaTypeOptional
string. One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements.
linkUrlOptional
string. If the element is a link, the URL it points to.
srcUrlOptional
string. Will be present for elements with a 'src' URL.
pageUrlOptional
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.
frameUrlOptional
string. The URL of the frame of the element where the context menu was clicked, if it was in a frame.
selectionTextOptional
string. The text for the context selection, if any.
editable
boolean. A flag indicating whether the element is editable (text input, textarea, etc.).
wasCheckedOptional
boolean. A flag indicating the state of a checkbox or radio item before it was clicked.
checkedOptional
boolean. A flag indicating the state of a checkbox or radio item after it is clicked.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?45.0Yes33
Firefox
Basic supportNo

Acknowledgements

This API is based on Chromium's chrome.contextMenus API. This documentation is derived from context_menus.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,