QOAL / localisetime

A web extension for localising times found in web pages
GNU General Public License v3.0
14 stars 0 forks source link

Strange behavior on text selection with some websites #18

Closed Naheulf closed 2 years ago

Naheulf commented 2 years ago

On some site there something odd with text selection when the extension is active.

For example takes the AlekAundra answer from Jun 15, 2022.

The second sentence is "Next chapter will be up Saturday 3PM PST / 6PM EST." if the extension is enabled the two times are converted to πŸ• 01:00 (except the clock is an svg instead of the unicode char)

If you select it with the mouse nothing special occur.

Now click at least one time on the first time and select the text again. It's now converted to the static text Next chapter will be up Saturday πŸ•01:00 / 01:00.

Trying to narrow down the requirement for this behaviour I first found out that the extension MUST be UN-paused to this happen.

However playing more with (un)pause the extension, click to (un)convert the time and (un)select the text I found something event strange : the extension fool/prank me:

Note : I use Firefox x64 101.0.1 on Windows 10.

QOAL commented 2 years ago

This behaviour is caused by a script on that website. setItem, in https://www.scribblehub.com/wp-content/themes/writeit-child/js/jsmenu-hl.js?ver=1.0.2 It just loves mangling the text by adding \ufeff (character info) where you're selecting. image

So this might be the extension unexpectedly having handling the mangled time, followed by the website changing the DOM.

(I'm busy with another project at the minute, but this seems like a fun thing to try and mitigate.)

QOAL commented 2 years ago

Sorry for the delay in fixing this. I've found the issue and have pushed 2802755. 1.28.13 is rolling out now. Please let me know if this update has any unexpected side effects.

Thank you for taking the time to report this, I appreciate it!

QOAL commented 2 years ago

I've reverted this fix for now. I noticed it causing page slow downs once or twice. I'll come up with a better fix soon.

Naheulf commented 2 years ago

Okay.