Looking for an addon to automatically select all instances of selected word in the current page

后端 未结 4 1199
春和景丽
春和景丽 2021-01-15 03:39

I am looking for an addon to install so that when you select a word in a webpage ( by clicking) it automatically highlights all the instances of that selected words in that

4条回答
  •  日久生厌
    2021-01-15 04:20

    Ok C Graphics man here's the code

    Ok its real easy you don't even have to write another function. Here's the code to highlight any word in the current tab.

    gBrowser.selectedTab.linkedBrowser.finder.highlight(true, 'YOUR_WORD_HERE')
    

    if you want to unighlight then set the first argument to false.

    You can do this in any tab just have to supply the browser element within the tab.

    like this code here will highlight everything in the first tab:

    gBrowser.tabContainer.childNodes[0].linkedBrowser.finder.highlight(true, 'YOUR_WORD_HERE');
    

提交回复
热议问题