Tutorial: Window.findInPage

Window.findInPage

Finds all matches for the specified text in the web page. By default, each subsequent call will highlight the next text that matches the search term.

Returns a promise with the results for the request. By subscribing to the found-in-page event, you can get the results of this call as well.

Example

const win = fin.Window.getCurrentSync();

//By subscribing to the 'found in page' event we can get the results of each findInPage call made.
win.addListener('found-in-page', (event) => {
    console.log(event);
});

// The promise also returns the results for the request
win.findInPage('a').then((result) => {
    console.log(result)
});