Created
October 7, 2018 20:00
-
-
Save avisek/cd19273b3d41941c2ffbc6d5a8711982 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
/** Whether we are using a Mac or not. */ | |
function isMac() { | |
return /Mac/.test(navigator.platform); | |
} | |
/** Whether this is on the Windows platform or not. */ | |
function isWindows() { | |
return /Win/.test(navigator.platform); | |
} | |
/** Whether this is on chromeOS or not. */ | |
function isChromeOS() { | |
return /CrOS/.test(navigator.userAgent); | |
} | |
/** Whether this is on vanilla Linux (not chromeOS). */ | |
function isLinux() { | |
return /Linux/.test(navigator.userAgent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment