Fixed running in Node.js

This commit is contained in:
Gustaf Räntilä
2017-11-13 11:27:15 +01:00
parent 05b5a85e1d
commit 1e75b41fd5
+1 -1
View File
@@ -5,7 +5,7 @@ module.exports = API;
var chromeApi = require( './google-u2f-api' );
// Feature detection (yes really)
var isBrowser = navigator && !!navigator.userAgent;
var isBrowser = ( typeof navigator !== 'undefined' ) && !!navigator.userAgent;
var isSafari = isBrowser && navigator.userAgent.match( /Safari\// )
&& !navigator.userAgent.match( /Chrome\// );
var isEDGE = isBrowser && navigator.userAgent.match( /Edge\/1[2345]/ );