diff --git a/src/shared/is_node.js b/src/shared/is_node.js index 937438662..1720edb13 100644 --- a/src/shared/is_node.js +++ b/src/shared/is_node.js @@ -15,9 +15,10 @@ /* globals module, process */ module.exports = function isNodeJS() { - // NW.js is a browser context, but copies some Node.js objects; see + // NW.js / Electron is a browser context, but copies some Node.js objects; see // http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context + // https://electronjs.org/docs/api/process#processversionselectron return typeof process === 'object' && process + '' === '[object process]' && - !process.versions['nw']; + !process.versions['nw'] && !process.versions['electron']; };