Some webpages (YouTube comments for example) use <div> as text input so isContentEditable needs be checked in addition.
Relevant minor changes:
Allowed double click to trigger popup in text input elements since it won't interfere with text editing like hotkeys do.
Added a mouse point save before getTranslation() to avoid the triggered popup displaying in somewhere else when the network is slow and the mouse is moved.
Added condition for the timeout to prevent triggering onSelectionEnd if there's no text selected.
Some webpages (YouTube comments for example) use
<div>
as text input soisContentEditable
needs be checked in addition.Relevant minor changes:
getTranslation()
to avoid the triggered popup displaying in somewhere else when the network is slow and the mouse is moved.onSelectionEnd
if there's no text selected.