You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code when used in a JavaScript interpreter for Go (Otto) throws an error: ReferenceError: 'navigator' is not defined.
This worked fine in previous versions of the module (I've tested 2.3.3).
Could a check be added to see if navigator exists?
functionuseColors(){// NB: In an Electron preload script, document will be defined but not fully// initialized. Since we know we're in Chrome, we'll just detect this case// explicitlyif(typeofwindow!=='undefined'&&'process'inwindow&&window.process.type==='renderer'){returntrue;}// is webkit? http://stackoverflow.com/a/16459606/376773// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632return(typeofdocument!=='undefined'&&'WebkitAppearance'indocument.documentElement.style)||// is firebug? http://stackoverflow.com/a/398120/376773(typeofwindow!=='undefined'&&window.console&&(console.firebug||(console.exception&&console.table)))||// is firefox >= v31?// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages(navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31)||// double check webkit in userAgent just in case we are in a worker(navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));}
The text was updated successfully, but these errors were encountered:
@thebigredgeek the problem is occurring with debug 2.4.4 (I've just retested to confirm).
The problem is occurring because navigator is undefined in this JavaScript interpreter.
I think it needs a typeof navigator !== 'undefined' test before the navigator.userAgent test.
The following code when used in a JavaScript interpreter for Go (Otto) throws an error:
ReferenceError: 'navigator' is not defined
.This worked fine in previous versions of the module (I've tested 2.3.3).
Could a check be added to see if
navigator
exists?The text was updated successfully, but these errors were encountered: