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

Is FileSaver.js ready for upcoming changes with navigator.userAgent in Chrome?

Open CtrlAltDel-me opened this issue 3 years ago • 2 comments

I am getting this information message using chrome:

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.

Affected resources:

FileSaver.js:1

Is the current version of FileSaver.js ready for this change?

CtrlAltDel-me avatar Jan 04 '22 13:01 CtrlAltDel-me

I don't think it's ready as using userAgent to detect mac web view https://github.com/eligrey/FileSaver.js/blob/9806041b0e800979dddabbaa1b5f6ce6952d7cd7/src/FileSaver.js#L72

Bykiev avatar Aug 22 '22 19:08 Bykiev

@Bykiev 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 in a way that you'll still get it (because of compatibility with Safari) but it will work with the new webpack stuff that most browsers have. I don't know if this will work with old web browsers.

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