We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e1ee4d5 commit 69480c3Copy full SHA for 69480c3
browser.js
@@ -37,6 +37,13 @@ exports.colors = [
37
*/
38
39
function useColors() {
40
+ // NB: In an Electron preload script, document will be defined but not fully
41
+ // initialized. Since we know we're in Chrome, we'll just detect this case
42
+ // explicitly
43
+ if (typeof window !== 'undefined' && 'process' in window && window.process.type === 'renderer') {
44
+ return true;
45
+ }
46
+
47
// is webkit? http://stackoverflow.com/a/16459606/376773
48
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
49
return (typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style) ||
0 commit comments