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

后端 未结 4 1166
春和景丽
春和景丽 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:37

    If you press ctrl+f and then click highlight all it will do it.

    If you want to copy it heres the code for highlihgt all:

    function toggleHighlight(aHighlight) {
    
              if (!this._dispatchFindEvent("highlightallchange"))
                return;
    
              let word = this._findField.value;
              // Bug 429723. Don't attempt to highlight ""
              if (aHighlight && !word)
                return;
    
              this.browser._lastSearchHighlight = aHighlight;
              this.browser.finder.highlight(aHighlight, word);
    
    }
    

    here it is on mxr

    if you need more help let me know

提交回复
热议问题