How to capture custom text event in Firefox

I want to catch an event when a user selects text on a Firefox page, such as an IDM add-in (or IE8 +), when a user selects text.

Can anybody help me?

+3
source share
2 answers

You could attach an event listener mouseupand a listener, keypressrespectively, to select the mouse and keyboard, and then use it window.getSelection()to indicate whether any text is selected.

+3
source

, . IE select, , . keyup mouseup .

0

Source: https://habr.com/ru/post/1779821/


All Articles