thednp / bootstrap.native

Bootstrap components build with Typescript
http://thednp.github.io/bootstrap.native/
MIT License
1.7k stars 177 forks source link

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

Closed kolbma closed 2 years ago

kolbma commented 2 years ago

There is an improvement notice in Chrome:

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

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

  2. AFFECTED RESOURCES
    1. 1 source
      1. bootstrap-native.min.js:1
thednp commented 2 years ago

Hmm this is something I forgot to split between V4 and V5...

We're only using that for legacy browsers fallback, but can we confirm this to be the case with Safari?

thednp commented 2 years ago

@kolbma I believe userAgent is here to stay for a while, at least the we have it implemented. Check this out

kolbma commented 2 years ago

If it works I've no problem with this. I think Google is producing the message because they are afraid of compatibility issues with their version numbers >= 100. So if bootstrap-native knows what to do on these new browser versions, all is fine I think.

thednp commented 2 years ago

No worry man, the scripts work with navigator.userAgentData with userAgent fallback. It should all be fine, except Chrome browsers notice. I mean, see for yourself.

thednp commented 2 years ago

@kolbma are we ok to close this?

thednp commented 2 years ago

Closed due to no activity.

kolbma commented 2 years ago

Ups. Sorry, forgot to comment your question. Close is of course fine.