Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Refine macOS WebView check so that it is false for browsers #652

Merged
merged 3 commits into from
May 28, 2020

Conversation

rajivshah3
Copy link
Contributor

@rajivshah3 rajivshah3 commented May 22, 2020

Refines check for macOS WebViews (originally implemented in #613) so that it is false for Chrome, Safari, etc.

User agent for WebView: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko)

Any browser running on macOS will have a similar user agent, but will also have one of these differences (source):

  • Firefox does not have AppleWebKit in the string
  • Chrome, Safari, Edge, Opera, Vivaldi, etc will also include Safari

Additionally, this is restricted to macOS (will be false on iOS) by testing for Macintosh

This fix is a bit more comprehensive, as #629 and #637 will still be true for Safari

Fixes #624

@rajivshah3 rajivshah3 marked this pull request as ready for review May 22, 2020 02:53
Copy link
Owner

@eligrey eligrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@eligrey eligrey merged commit 5bb701b into eligrey:master May 28, 2020
@rajivshah3 rajivshah3 deleted the fix/only-macos-webview branch May 28, 2020 02:05
@o-alexandrov
Copy link

Please let us know when do you plan to release it to npm?

@crgeee
Copy link

crgeee commented Aug 6, 2020

@eligrey @rajivshah3 is this going to be released?

@rajivshah3
Copy link
Contributor Author

I'm not a maintainer so I'm not really sure

@crgeee
Copy link

crgeee commented Aug 14, 2020

@jimmywarting I saw you made a new release but not seeing it published - https://www.npmjs.com/package/file-saver. Is the latest version available in another package registry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest commit breaks file download in Chrome
4 participants