Use the browser.find API to interact with the browser's Find interface.

Permissions: find

Not allowed in: Content scripts, Devtools pages

_FindParams
_HighlightResultsParams
find
highlightResults
removeHighlighting
  • Search for text in document and store found ranges in array, in document order.

    Parameters

    • queryphrase: string

      The string to search for.

    • Optionalparams: _FindParams

      Search parameters.

    Returns Promise<
        {
            count: number;
            rangeData?: {
                endOffset: number;
                endTextNodePos: number;
                framePos: number;
                startOffset: number;
                startTextNodePos: number;
            }[];
            rectData?: {
                rectsAndTexts: {
                    rectList: {
                        bottom: number;
                        left: number;
                        right: number;
                        top: number;
                    }[];
                    textList: string[];
                };
                textList: string;
            }[];
        },
    >

  • Highlight a range

    Parameters

    Returns void

  • Remove all highlighting from previous searches.

    Parameters

    • OptionaltabId: number

      Tab to highlight. Defaults to the active tab.

    Returns void