mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
fix: electron enviroment detection
This commit is contained in:
parent
9b5a937f78
commit
1472c10bab
1 changed files with 3 additions and 2 deletions
|
@ -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'];
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue