Skip to content

ElectronContextMenuParams

Unofficial

Parameters describing the context in which a context menu was invoked.

Import:

import type { ElectronContextMenuParams } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ElectronContextMenuParams

Properties

PropertyTypeDescription
altTextstringAlt text of the selection that the context menu was invoked on.
dictionarySuggestionsstring[]Suggested words to replace the misspelledWord. Only available when there is a misspelled word and spellchecker is enabled.
editFlagsElectronEditFlagsFlags indicating whether the renderer can perform the corresponding editing action.
frameElectronWebFrameMainFrame from which the context menu was invoked.
frameCharsetstringThe character encoding of the frame on which the menu was invoked.
frameURLstringURL of the subframe that the context menu was invoked on.
hasImageContentsbooleanWhether the context menu was invoked on an image which has non-empty contents.
inputFieldTypestringIf the context menu was invoked on an input field, the type of that field.
isEditablebooleanWhether the context is editable.
linkTextstringText associated with the link. May be an empty string if the contents of the link are an image.
linkURLstringURL of the link that encloses the node the context menu was invoked on.
mediaFlagsElectronMediaFlagsThe flags for the media element the context menu was invoked on.
mediaType'audio' | 'canvas' | 'file' | 'image' | 'none' | 'plugin' | 'video'Type of the node the context menu was invoked on.
menuSourceType'adjustSelection' | 'adjustSelectionReset' | 'keyboard' | 'longPress' | 'longTap' | 'mouse' | 'none' | 'stylus' | 'touch' | 'touchHandle' | 'touchMenu'Input source that invoked the context menu.
misspelledWordstringThe misspelled word under the cursor, if any.
pageURLstringURL of the top level page that the context menu was invoked on.
referrerPolicyElectronReferrerThe referrer policy of the frame on which the menu is invoked.
selectionRectElectronRectangleRect representing the coordinates in the document space of the selection.
selectionStartOffsetnumberStart position of the selection text.
selectionTextstringText of the selection that the context menu was invoked on.
spellcheckEnabledbooleanWhether spellchecking is enabled, if the context is editable.
srcURLstringSource URL for the element that the context menu was invoked on.
suggestedFilenamestringSuggested filename to be used when saving the file through the 'Save Link As' context menu option.
titleTextstringTitle text of the selection that the context menu was invoked on.
xnumberThe x coordinate.
ynumberThe y coordinate.