Created
August 21, 2020 11:32
-
-
Save jpescada/aaa214b7b32b23df3a722edf703cf201 to your computer and use it in GitHub Desktop.
Detect WebKit browser on (mobile) iOS device
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent | |
const isWebkit = (): boolean => { | |
const UA = navigator.userAgent | |
return /\b(iPad|iPhone|iPod)\b/.test(UA) && /WebKit/.test(UA) && | |
!/Edge/.test(UA) && !window.MSStream | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment