I'm unable to say whether this should be a PR at the present time but would like to ask whether the following contains any improvements (by way of generalizations) to the current env detection implementation. Specifically I think the following catches Electron.
var ENVIRONMENT_IS_WEB=typeof window==="object";
var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";
var ENVIRONMENT_IS_NODE=typeof process==="object"&&process.browser !== true&&typeof require==="function" && ENVIRONMENT_IS_WORKER == false; // we want this to be true for Electron but not for a WebView nor e.g. Cordova (latter not checked here)
var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;
I'm unable to say whether this should be a PR at the present time but would like to ask whether the following contains any improvements (by way of generalizations) to the current env detection implementation. Specifically I think the following catches Electron.