Item Types and Native Actions
Each row of a page context-menu template has a kind and may bind an action through role. See Page Context Menu for the full API and examples.
Item kinds
| kind | Type | Description | Platform |
|---|---|---|---|
| 0 | Command | Performs an action; without role it reports context-menu-click | |
| 1 | Submenu | Children point to its id through parent_id | |
| 2 | Separator | Not clickable | |
| 3 | Checkbox | Toggles checked state; flags bit 1 means checked | |
| 4 | Radio | Mutually exclusive in its group; flags bit 1 means checked |
role applies to commands, checkboxes, and radios only; submenus and separators do not need it.
Actions (role)
Editing
| Action | role | Platform |
|---|---|---|
| Undo | undo | |
| Redo | redo | |
| Cut | cut | |
| Copy | copy | |
| Paste | paste | |
| Paste as plain text | pasteAndMatchStyle | |
| Delete | delete | |
| Select all | selectAll | |
| Emoji | emoji |
Navigation
| Action | role | Platform |
|---|---|---|
| Back | back | |
| Forward | forward | |
| Reload | reload | |
| Force reload | forceReload |
Page
| Action | role | Platform |
|---|---|---|
print | ||
| Save as | saveAs | |
| View source | viewSource | |
| Inspect element | inspectElement | |
| DevTools | toggleDevTools | |
| Zoom in | zoomIn | |
| Zoom out | zoomOut | |
| Reset zoom | resetZoom | |
| Toggle full screen | togglefullscreen | |
| Minimize | minimize | |
| Close window | close | |
| Quit | quit |
Link
| Action | role | Platform |
|---|---|---|
| Open in new window | openLinkInNewWindow | |
| Save link as | saveLinkAs | |
| Copy link | copyLink | |
| Copy link to highlight | copyLinkToHighlight |
Image
| Action | role | Platform |
|---|---|---|
| Save image as | saveImageAs | |
| Copy image | copyImage | |
| Copy image address | copyImageAddress | |
| Magnify image | magnifyImage | |
| Share | share |
Media
| Action | role | Platform |
|---|---|---|
| Save media as | saveMediaAs | |
| Copy link | copyLink | |
| Show/hide controls | toggleMediaControls |
The platform column shows availability; other platforms are disabled. role names ignore case and separators.