Skip to content

Commit af5aef0

Browse files
committed
fix: avoid using native Node.js modules in the Electron renderer process.
1 parent 2bb97af commit af5aef0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ var util = module.exports = forge.util = forge.util || {};
108108

109109
// check if running under Node.js
110110
util.isNodejs =
111-
typeof process !== 'undefined' && process.versions && process.versions.node;
111+
typeof process !== 'undefined' && process.versions && process.versions.node && !(process.versions['electron'] && process.type === 'renderer');
112112

113113

114114
// 'self' will also work in Web Workers (instance of WorkerGlobalScope) while

0 commit comments

Comments
 (0)