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?
To fix this issue, replace the usage of navigator. userAgent, navigator. appVersion, and navigator. platform with feature detection, progressive enhancement, or migrate to navigator.
The Navigator userAgent property is used for returning the user-agent header's value sent to the server by the browser. It returns a string representing values such as the name, version, and platform of the browser.
The Navigator appVersion Property is a read-only property and it returns a string which represents the version information of the browser. It is used for returning the information related to the version of the browser.
The Navigator platform property is used for returning the platform for which the browser is compiled. It returns a string representing the platform of the browser. The possible values are: MacIntel. MacPPC.
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With