最近发现 Google 浏览器提示如下信息

    1. Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform
    2. 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.
    3. 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.
    4. Note that for performance reasons, only the first access to one of the properties is shown.

    在Chrome的未来版本中,用户代理字符串中可用的信息量将减少。

    以后要改用 navigator.userAgentData 了,信息量确实减少了很多

    1. // navigator.userAgentData 在 Chrome 上输出格式如下
    2. {
    3. brands: [
    4. {brand: "Chromium", version: "92"},
    5. {brand: " Not A;Brand", version: "99"},
    6. {brand: "Google Chrome", version: "92"}
    7. ],
    8. mobile: false,
    9. }