ContextMenuOptions
Options for constructing a context menu.
import { ContextMenuOptions } from '@mobrowser/api';
Example
import { app, ContextMenu, ContextMenuItem } from '@mobrowser/api';
const win = app.createWindow()
win.browser.handle('showContextMenu', () => {
return new ContextMenu({
label: 'Context Menu',
items: [
new ContextMenuItem({ label: 'Do something', action: (item: ContextMenuItem) => { } }),
]
})
})
win.show()
Properties
label
readonly label?: string;
The label of the menu.
items
readonly items: (ContextMenuElement | ContextMenuItemRole)[];
The items of the menu.