Trilium Electron API
    Preparing search index...

    Interface ElectronNavigationApi

    Accessors for the underlying Chromium navigation history of the current web contents (back/forward stack), exposed so the renderer can mirror it in custom UI such as the breadcrumb / tab back button.

    interface ElectronNavigationApi {
        clearNavigationHistory(): void;
        navigationCanGoBack(): boolean;
        navigationCanGoForward(): boolean;
        navigationGetActiveIndex(): number;
        navigationGetAllEntries(): { title: string; url: string }[];
        navigationGoToIndex(index: number): void;
        navigationLength(): number;
        onDidNavigate(callback: () => void): void;
        onDidNavigateInPage(callback: () => void): void;
        removeDidNavigateListeners(): void;
    }
    Index

    Methods

    • Clears the entire back/forward navigation history.

      Returns void

    • Synchronously returns whether a back navigation is possible.

      Returns boolean

    • Synchronously returns whether a forward navigation is possible.

      Returns boolean

    • Returns the index of the currently active entry inside navigationGetAllEntries.

      Returns number

    • Returns every entry in the navigation history, oldest first.

      Returns { title: string; url: string }[]

    • Navigates to the entry at the given index in the history stack.

      Parameters

      • index: number

      Returns void

    • Returns the total number of entries in the navigation history.

      Returns number

    • Subscribes to top-level navigation events (URL changes that load a new document).

      Parameters

      • callback: () => void

      Returns void

    • Subscribes to in-page navigation events (hash changes, history.pushState).

      Parameters

      • callback: () => void

      Returns void

    • Removes all listeners registered via onDidNavigate and onDidNavigateInPage.

      Returns void