Audit usage of navigator useragent navigator appversion and navigator platform ошибка

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...

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

enter image description here

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

Weronika's user avatar

WeronikaWeronika

3181 gold badge3 silver badges15 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):
enter image description here

Right click on the file and then choose Open in new tab.

enter image description here

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:

  1. ignore it
  2. wait for the authors of the library to fix the issue and update it
  3. disable the extension/remove the library causing it.

answered Nov 23, 2021 at 17:02

Alexander Mihailov's user avatar

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

sldorman's user avatar

sldormansldorman

1452 silver badges11 bronze badges

🐛 Bug Report

Chrome is throwing improvement info that navigator.userAgent won’t be supported starting from Chrome version 101 and all usages have to be replaced with navigator.userAgentData.

Occurence is in «isIE10» in file https://github.com/i18next/i18next/blob/5a9bba39a56a24b325058a6bd88516c0b19fede9/src/utils.js

To Reproduce

  1. Use library in any project
  2. Run Lighthouse report from ChromeDev tools with «Best practices» checkbox selected
  3. Switch to console tab
  4. Open issues — one issue found:
  • Title: «Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform»
  • Description: «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.»
  • More details about issue: https://blog.chromium.org/2021/09/user-agent-reduction-origin-trial-and-dates.html

Expected behaviour

No issue related with library

Your Environment

  • runtime version: node v16.14.0
  • i18next version: 21.6.14
  • os: Mac
  • Chrome: v100.0.4896.127

Screenshot 2022-05-18 at 08 01 40

  • 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

image

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

  • 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

image

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

enter image description here

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):
enter image description here

Right click on the file and then choose Open in new tab.

enter image description here

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:

  1. ignore it
  2. wait for the authors of the library to fix the issue and update it
  3. 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

Я начал новый проект на vue.js. Я добавил навбар. В какой-то момент я заметил проблему в консоли:

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

enter image description here

Я этого не понимаю, потому что никакого навигатора в проекте не использую.

Почему я вижу эту проблему? Как я могу это изменить?

2 ответа

Лучший ответ

Причина, по которой человек видит сообщение, хорошо объясняется в описании того же сообщения (аудит).

Настоящий вопрос в том, кто / что является его источником. Есть подсказка к файлу extended-css.js.

Вот пример с другим файлом (поскольку у меня нет extended-css.js): введите здесь описание изображения

Щелкните файл правой кнопкой мыши и выберите Open in new tab.

enter image description here

Итак, вы можете видеть, что причиной сообщения аудита является файл hook.js из расширения Vue.js devtools.

В вашем случае это будет другое расширение или библиотека, которую вы используете — прямая или косвенная (например, часть vuetify и т. Д.).

Оттуда у вас есть 3 варианта:

  1. игнорируй это
  2. дождитесь, пока авторы библиотеки исправят проблему, и обновите ее
  3. отключить расширение / удалить вызывающую его библиотеку.


8

Alexander Mihailov
23 Ноя 2021 в 20:02

https://blog.chromium.org/2021/05/update-on-user-agent-string-reduction.html

Полезно читать. Некоторые ключевые моменты:

«Начиная с M92, мы планируем начать рассылку уведомлений об устаревании для получателей navigator.userAgent, navigator.appVersion и navigator.platform на вкладке« Проблемы DevTools »».

«Если ваш сайт, служба, библиотека или приложение полагаются на определенные биты информации, присутствующие в строке User Agent, такие как дополнительная версия Chrome, номер версии ОС или модель устройства Android, вам нужно будет начать миграцию, чтобы использовать User Agent. Client Hints API вместо этого «.

Я знаю, что не использую рассматриваемые геттеры навигатора, поэтому на данный момент мне кажется, что я могу только дождаться обновления библиотеки .js (в моем случае — bootstrap 4), чтобы предупреждение исчезло.


5

sldorman
1 Сен 2021 в 22:14

Понравилась статья? Поделить с друзьями:
  • Audit usage of navigator useragent navigator appversion and navigator platform как исправить
  • Audiowizard error 1722
  • Audiosurf runtime error
  • Audioplaybackdiagnostic код ошибки 0x80070057
  • Audioop error not a whole number of frames