Skip to content

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

Merged
eligrey merged 3 commits into
eligrey:masterfrom
rajivshah3:fix/only-macos-webview
May 28, 2020
Merged

fix: Refine macOS WebView check so that it is false for browsers#652
eligrey merged 3 commits into
eligrey:masterfrom
rajivshah3:fix/only-macos-webview

Conversation

@rajivshah3

@rajivshah3 rajivshah3 commented May 22, 2020

Copy link
Copy Markdown
Contributor

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 force-pushed the fix/only-macos-webview branch from f397f3d to e5e74d6 Compare May 22, 2020 02:48
@rajivshah3
rajivshah3 marked this pull request as ready for review May 22, 2020 02:53

@eligrey eligrey left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown

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

@crgeee

crgeee commented Aug 6, 2020

Copy link
Copy Markdown

@eligrey @rajivshah3 is this going to be released?

@rajivshah3

Copy link
Copy Markdown
Contributor Author

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

@crgeee

crgeee commented Aug 14, 2020

Copy link
Copy Markdown

@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