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

Simplify WebKit detection #9

Merged
merged 3 commits into from
Jun 20, 2019
Merged

Simplify WebKit detection #9

merged 3 commits into from
Jun 20, 2019

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jun 20, 2019

detect-browser module is too heavy just to detect WebKit. We've updated WebKit detection logic to use the value of navigator.vendor. Any dependencies are no longer required.

According to WHATWG specification, it returns which of Google, Inc., Apple Computer, Inc., and the empty string. So we determine applying WebKit polyfill by whether there is Apple Computer, Inc. string.

It will be shrinked the built JS size dramatically. e.g. Build for browser becomes from 4568bytes to 947bytes. (about 5x smaller)

navigator.vendor returns which of "Google, Inc.", "Apple Computer, Inc."
and the empty string. We can detect as using WebKit if vendor is Apple.
detect-browser is no longer required and the built results are smaller.
@yhatt yhatt merged commit 464877f into master Jun 20, 2019
@yhatt yhatt deleted the simplify-webkit-detection branch June 20, 2019 15:32
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.

1 participant