FileSaver.js icon indicating copy to clipboard operation
FileSaver.js copied to clipboard

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

Open gian1200 opened this issue 4 years ago • 1 comments

Description

On Chrome there is an audit message when using FileSaver.js 2.0.5.

Version

2.0.5 (installed via NPM)

Evidence

image

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. Learn more: User-Agent String Reduction

Request

Is there any plan to address this?

gian1200 avatar Nov 24 '21 23:11 gian1200

This is the same question I asked [issue #739]. Anyway, I was just looking through the latest source code on this; eligrey is still updating the source (as of June), and I think the reference to useAgent is now only for detecting Safari (that's what the comments in the source say). I'm not sure how backward compatible the latest version is, but the eligrey seems to have addressed the userAgent warning

CtrlAltDel-me avatar Aug 27 '22 18:08 CtrlAltDel-me