Firefox addon - how to listen to a text highlight event on a web page

I am writing an addon that needs to be done in order to capture the time when someone highlighted some text on a web page. Is there any way to listen to this event?

Thanks Kapil

+2
firefox-addon xul
Jan 6 2018-11-11T00:
source share
2 answers

There is no special event for this. But you can listen to the mouseup event and check the selection returned by window.getSelection() not empty and / or different from the previous selection.

+4
Jan 06 '11 at 20:13
source share

You can add a listener. The Source window (viewSource.js) does this so that it can update the row and column number.

+2
Jan 10 2018-11-11T00:
source share



All Articles