bowser icon indicating copy to clipboard operation
bowser copied to clipboard

Support: User Agent string will be reduced In a future version of Chrome

Open michael-ecb opened this issue 3 years ago • 3 comments

Hi, there is a warning in chrome: 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

does this package already support it or need a new release ?

thanks

michael-ecb avatar Oct 10 '21 07:10 michael-ecb

I'd like to know more about this, too. Chrome now actively warns about deprecating navigator.userAgent.

Any information about this would be appreciated, @lancedikson.

Akazm avatar Jan 05 '22 07:01 Akazm

Hi! Thanks for the heads-up! I hadn't checked it before, but a quick look into the topic showed that there's not much to change for bowser. It's only the device information that could be lost with the upcoming reduction, but the rest should be fine as I can see from the spec of the final reduced state: https://www.chromium.org/updates/ua-reduction#TOC-Sample-UA-Strings:-Final-Reduced-State

lancedikson avatar Jan 05 '22 08:01 lancedikson

Wow, thank you for your quick response!

Is there any plan on adding device information to Bowser in the future? As far as I know, some platform information was partially simply 'moved' to navigator.userAgentData.

Another, significantly more reliable option is using the Client Hints API:

navigator.userAgentData.getHighEntropyValues(
  ["architecture",
  "model",
  "platform",
  "platformVersion",
  "fullVersionList"]).then(ua => { console.log(ua) });

Akazm avatar Jan 05 '22 08:01 Akazm