dessant / search-by-image

Browser extension for reverse image search, available for Chrome, Edge and Safari
https://apps.apple.com/us/app/search-by-image-for-safari/id1544552106
GNU General Public License v3.0
2.28k stars 200 forks source link

Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform webhint warning #198

Closed xayanide closed 2 years ago

xayanide commented 2 years ago

System

Bug description

I think that this is an insignificant and minor issue. I am not sure when this happened since I had discovered it from the browser's DevTools, it has webhint integrated.

Looking up the console logs in inspect element on any website, I always see this warning from the Issues tab, disabling, deleting the extension or going incognito mode gets rid of this webhint warning.

Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform

A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced.

To fix this issue, replace the usage of navigator.userAgent, > navigator.appVersion, and navigator.platform with feature > detection, progressive enhancement, or migrate to > navigator.userAgentData.

Note that for performance reasons, only the first access to one of the properties is shown.

AFFECTED RESOURCES
1 source
script.js:1

Hovering the cursor over the affected resource called script.js:1, a tooltip will be seen, leading us back to this extension.

chrome-extension://cnojnbdhbhnkbcieeekonklommdnndci/src/insert/script.js

While this wasn't really affecting anything about functionality, I think this webhint can be fixed so that the warning will no longer appear regardless of its insignificance.

dessant commented 2 years ago

This warning is present on most sites without the extension, even on Chrome's new tab page. I agree that at some point we should find alternative ways to request the same data, but navigator.platform and navigator.userAgent are still universally supported, while the alternative API is experimental. The internals of the extension and log messages meant for developers should not concern users, unless something stops working.