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 ElectronContextMenuParamsProperties
| Property | Type | Description | |
|---|---|---|---|
| altText | string | Alt text of the selection that the context menu was invoked on. | |
| dictionarySuggestions | string[] | Suggested words to replace the misspelledWord. Only available when there is a misspelled word and spellchecker is enabled. | |
| editFlags | ElectronEditFlags | Flags indicating whether the renderer can perform the corresponding editing action. | |
| frame | ElectronWebFrameMain | Frame from which the context menu was invoked. | |
| frameCharset | string | The character encoding of the frame on which the menu was invoked. | |
| frameURL | string | URL of the subframe that the context menu was invoked on. | |
| hasImageContents | boolean | Whether the context menu was invoked on an image which has non-empty contents. | |
| inputFieldType | string | If the context menu was invoked on an input field, the type of that field. | |
| isEditable | boolean | Whether the context is editable. | |
| linkText | string | Text associated with the link. May be an empty string if the contents of the link are an image. | |
| linkURL | string | URL of the link that encloses the node the context menu was invoked on. | |
| mediaFlags | ElectronMediaFlags | The 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. | |
| misspelledWord | string | The misspelled word under the cursor, if any. | |
| pageURL | string | URL of the top level page that the context menu was invoked on. | |
| referrerPolicy | ElectronReferrer | The referrer policy of the frame on which the menu is invoked. | |
| selectionRect | ElectronRectangle | Rect representing the coordinates in the document space of the selection. | |
| selectionStartOffset | number | Start position of the selection text. | |
| selectionText | string | Text of the selection that the context menu was invoked on. | |
| spellcheckEnabled | boolean | Whether spellchecking is enabled, if the context is editable. | |
| srcURL | string | Source URL for the element that the context menu was invoked on. | |
| suggestedFilename | string | Suggested filename to be used when saving the file through the 'Save Link As' context menu option. | |
| titleText | string | Title text of the selection that the context menu was invoked on. | |
| x | number | The x coordinate. | |
| y | number | The y coordinate. |