- Can the issue be reproduced in a fresh browser profile? Yes
- Is there an existing issue about this? No
Bug Report
Bug Description
Some of the navigator features that Dark Reader relies on will soon change, breaking many scripts.
Steps To Reproduce
- Open the console
- Click on issues
- Click on «Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform»
Expected Behavior
No issues from the injected script src/index.js (from src/utils/platform.ts). Feature detection should be used instead.
Actual Behavior
Lots of scripts use the file src/utils/platform.ts, which uses navigator.
Screenshots
System Information
- OS: Any
- Browser: Any
- Dark Reader Version: Any
Additional Context
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.
Learn more: User-Agent String Reduction
I started a new project in vue.js. I added navbar. At one point, I noticed issue in the console:
Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform
I don’t understand this, because I don’t use any navigator in the project.
Why am I seeing this issue? How can I change it?
asked Aug 30, 2021 at 9:58
WeronikaWeronika
3681 gold badge3 silver badges16 bronze badges
3
The reason one sees the message is well explained in the description of the very same message (audit).
The real question is who/what is the source of it. There is a hint to the file extended-css.js
.
Here is an example with another file (as I do not have the extended-css.js
):
Right click on the file and then choose Open in new tab
.
So there you can see that the reason for the audit message is the hook.js
file from the Vue.js devtools extension.
In your case it would be another extension or library you are using — direct or indirect (for example a part of vuetify
, etc.).
From there you have 3 choices:
- ignore it
- wait for the authors of the library to fix the issue and update it
- disable the extension/remove the library causing it.
answered Nov 23, 2021 at 17:02
https://blog.chromium.org/2021/05/update-on-user-agent-string-reduction.html
Is helpful to read. Some key points:
«Beginning in M92, we plan to start sending deprecation notices for the navigator.userAgent,
navigator.appVersion, and navigator.platform getters in the DevTools Issues tab.»
«If your site, service, library or application relies on certain bits of information being present in the User Agent string such as Chrome minor version, OS version number, or Android device model, you will need to begin the migration to use the User Agent Client Hints API instead.»
I know I am not using the navigator getters in question so at this point, it seems I can only wait for an update to the library’s .js
(in my case, bootstrap 4) to make the warning go away.
answered Sep 1, 2021 at 19:14
sldormansldorman
1452 silver badges11 bronze badges
🐛 Bug Report
After adopting react-aria
(specifically "@react-aria/button": "^3.3.2"
) in my codebase, I notice that Chrome shows a warning about accessing window.navigator.userAgent
and window.navigator.platform
.
🤔 Expected Behavior
The warning should not appear.
😯 Current Behavior
Chrome (Version 92.0.4515.107 (Official Build) (64-bit)) shows the following warning:
Full text:
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. In a future version of Chrome, 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. 1 source client.js:1 Learn more: User-Agent String Reduction
💁 Possible Solution
Research options described in Update on User-Agent String Reduction in Chrome. One viable options may be to migrate to navigator.userAgentData
.
Access of the offending fields appears localized to https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/utils/src/platform.ts.
🔦 Context
💻 Code Sample
🌍 Your Environment
"@react-aria/button": "^3.3.2"
Chrome (Version 92.0.4515.107 (Official Build) (64-bit))
Ubuntu Linux
Google Chrome Help
Sign in
Google Help
- Help Center
- Community
- Google Chrome
- Privacy Policy
- Terms of Service
- Submit feedback
Send feedback on…
This help content & information
General Help Center experience
- Help Center
- Community
Google Chrome
I started a new project in vue.js. I added navbar. At one point, I noticed issue in the console:
Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform
I don’t understand this, because I don’t use any navigator in the project.
Why am I seeing this issue? How can I change it?
Solution
The reason one sees the message is well explained in the description of the very same message (audit).
The real question is who/what is the source of it. There is a hint to the file extended-css.js
.
Here is an example with another file (as I do not have the extended-css.js
):
Right click on the file and then choose Open in new tab
.
So there you can see that the reason for the audit message is the hook.js
file from the Vue.js devtools extension.
In your case it would be another extension or library you are using – direct or indirect (for example a part of vuetify
, etc.).
From there you have 3 choices:
- ignore it
- wait for the authors of the library to fix the issue and update it
- disable the extension/remove the library causing it.
Answered By – Alexander Mihailov
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0