From af5aef0a72d8379c0e0d2a8b462c0cc2c657bd23 Mon Sep 17 00:00:00 2001 From: Thulof Qu Date: Sat, 1 Mar 2025 17:46:50 +0800 Subject: [PATCH] fix: avoid using native Node.js modules in the Electron renderer process. --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index aaede5ad2..b74770f4d 100644 --- a/lib/util.js +++ b/lib/util.js @@ -108,7 +108,7 @@ var util = module.exports = forge.util = forge.util || {}; // check if running under Node.js util.isNodejs = - typeof process !== 'undefined' && process.versions && process.versions.node; + typeof process !== 'undefined' && process.versions && process.versions.node && !(process.versions['electron'] && process.type === 'renderer'); // 'self' will also work in Web Workers (instance of WorkerGlobalScope) while