Created
September 2, 2020 02:59
-
-
Save daybrush/570312e3cb8292d360ae12383f1f123f to your computer and use it in GitHub Desktop.
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
import getAgent from "@egjs/agent"; | |
const agent = getAgent(); | |
// check Mac | |
export const isMacintosh = agent.os.name === "mac"; | |
// for pc mode in iOS | |
export const isIOS = (isMacintosh || agent.os.name === "ios") && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0; | |
// check android 4 | |
export const isAndroid4 = agent.os.name === "android" && agent.os.majorVersion === 4; | |
// check safari | |
export const isSafari = agent.browser.name === "safari"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment