Last active
March 29, 2019 14:55
-
-
Save mikaelhadler/9483713dc9e24a8c7c8d814ef483fd75 to your computer and use it in GitHub Desktop.
Service for get name the browser in 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
let _getUserDevice = function () { | |
let userAgent = $window.navigator.userAgent; | |
let browsers = {chrome: /chrome/i, safari: /safari/i, firefox: /firefox/i}; | |
for(let key in browsers){ | |
if (browsers[key].test(userAgent)) { | |
return key; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment