Rob--W / dont-track-me-google

Firefox and Chrome extensions to prevent Google from making links ugly.
MIT License
459 stars 26 forks source link

First click not sanitised on Google images #42

Closed sittaneumayer closed 3 years ago

sittaneumayer commented 3 years ago
  1. Search on images.google.com, or on google.com and switch to images.
  2. Left click on an image to open the sidebar.
  3. (Right or left) click on the selected image or the title. (link unsanitised)
  4. (Right or left) click on the selected image or the title again. (link sanitised)
  5. Repeat from step 2 indefinitely.

Using version 4.23.1 on Firefox 85.0.2.

Rob--W commented 3 years ago

Thanks for the detailed reproduction steps.

I followed your steps, and while I am able to see that the tooltip has the old URL, the actual URL that opens (or is copied when the context menu is chosen) is sanitized.

The reason for the tooltip being off is that Google turns the link into an unsanitized URL again (from a mousedown, touchstart or focus handler) after the extension has sanitized it (at mousedown). While this doesn't impact the clicked link, it does make the tooltip ugly. I can try to counter this by sanitizing the URL ASAP whenever the mouse pointer moves (or on a timer after sanitizing the link once), but that does slightly increase the complexity of the extension.

Do you still see a problem with the current behavior (i.e. copied/opened link is sanitized even though the tooltip sometimes is not)?

sittaneumayer commented 3 years ago

Demonstrating the first click being unsanitised here

https://user-images.githubusercontent.com/79370369/108604868-7d1f0780-73c1-11eb-8975-3a47208e174a.mp4

Rob--W commented 3 years ago

Fixed and published as version 4.24, thanks again for your report and STR.