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

  • 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

🐛 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:

image

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

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

Есть сайт https://vladikavkaz.site/
На нём мобильная версия выглядит нормально, но стоит только заполнить форму сайт отправлят редирект и перебрасывает на страницу «Спасибо за заказ» но там при мобильной версии появляется горизонтальный скрол

Как это исправить?

Сайт: https://vladikavkaz.site/
Страница спасибо за заказ: https://vladikavkaz.site/elementor-325/

Ошибки с Google Консоли:

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.

Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute
Because a cookie’s SameSite attribute was not set or is invalid, it defaults to SameSite=Lax, which prevents the cookie from being sent in a cross-site request. This behavior protects user data from accidentally leaking to third parties and cross-site request forgery.
Resolve this issue by updating the attributes of the cookie:
Specify SameSite=None and Secure if the cookie should be sent in cross-site requests. This enables third-party use.
Specify SameSite=Strict or SameSite=Lax if the cookie should not be sent in cross-site requests.

Понравилась статья? Поделить с друзьями:
  • Atom smasher error message
  • Atom php error
  • Atom install package error
  • Atmosphere error code 2162 0002
  • Atmega chip enable program error