Created
March 31, 2017 15:34
-
-
Save thombashi/c6c8931d79551b4e223ae852e84cc98c to your computer and use it in GitHub Desktop.
Javascript: Detect browser
This file contains hidden or 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
<!doctype html> | |
<html> | |
<body> | |
<script> | |
const isChrome = navigator.userAgent.toLowerCase().indexOf("chrome") !== -1; | |
const isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1; | |
console.log(`isChrome: ${isChrome}`); | |
console.log(`isFirefox: ${isFirefox}`); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment