Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 3834f8b

Browse files
access window via global in case not defined
1 parent 0beba87 commit 3834f8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/opencv4nodejs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const isElectronWebpack =
55
// assume module required by webpack if no system path inv envs
66
!process.env.path
77
// detect if electron https://github.com/electron/electron/issues/2288
8-
&& window && window.process && window.process.type
9-
&& navigator && ((navigator.userAgent || '').toLowerCase().indexOf(' electron/') > -1)
8+
&& global.window && global.window.process && global.window.process.type
9+
&& global.navigator && ((global.navigator.userAgent || '').toLowerCase().indexOf(' electron/') > -1)
1010

1111
let cv = isElectronWebpack ? require('../build/Release/opencv4nodejs.node') : require('./cv')
1212

0 commit comments

Comments
 (0)