ODH icon indicating copy to clipboard operation
ODH copied to clipboard

Added support for isContentEditable

Open skygate2012 opened this issue 4 years ago • 2 comments

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.

skygate2012 avatar Mar 25 '22 17:03 skygate2012

@ninja33 Hi, can you review this? These are small but critical fixes. I have been using my custom fork because of this one change. More and more websites/apps are using custom elements (some even web components) with contenteditable=true these days.

skygate2012 avatar Mar 14 '25 00:03 skygate2012

@ninja33 Hi, can you review this? These are small but critical fixes. I have been using my custom fork because of this one change. More and more websites/apps are using custom elements (some even web components) with contenteditable=true these days.

upon some users feedback, when selected text in editable area, the extension will crash. so in the very early version, I just simply disabled it. if you are fully tested this case without issue, I am OK.

btw, because it's PR before 3 years, please help submit a new PR upon branch manifest-v3

ninja33 avatar Mar 14 '25 03:03 ninja33