Trilium Electron API
    Preparing search index...

    Interface ElectronContextMenuApi

    Bridge for the native context menu shown over web contents.

    interface ElectronContextMenuApi {
        onContextMenu(
            callback: (params: ElectronContextMenuParams) => void,
        ): void;
        webContentsAction(
            action: "cut" | "copy" | "paste" | "pasteAndMatchStyle" | "insertText",
            text?: string,
        ): void;
    }
    Index

    Methods

    • Subscribes to right-click events forwarded from the main process.

      Parameters

      Returns void

    • Executes a clipboard / text-input action on the focused web contents. "insertText" requires the text argument; the other actions ignore it.

      Parameters

      • action: "cut" | "copy" | "paste" | "pasteAndMatchStyle" | "insertText"
      • Optionaltext: string

      Returns void