Highlights the results of a previous call to find.find()
.
When an extension calls find()
, the matches are not highlighted automatically, but they are stored by the browser. Call highlightResults()
to highlight them.
Note that the stored results are global across all extensions, so for example, if extension A calls find("apple")
, then extension B calls find("banana")
, then if extension A calls highlightResults()
, the results for "banana" will be highlighted.
Syntax
browser.find.highlightResults()
Parameters
None.
Return value
None.
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Chrome | Edge | Firefox | Firefox for Android | Opera | |
---|---|---|---|---|---|
Basic support | No | No | 57 | No | No |
Examples
Search the active tab for "banana", log the number of matches, and highlight them:
function found(results) { console.log(`There were: ${results.count} matches.`); if (results.count > 0) { browser.find.highlightResults(); } } browser.find.find("banana").then(found);