Possible improvements to env detection?
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;
Please have a look at this new PR https://github.com/emscripten-core/emscripten/pull/8594 and feel free to join the discussion.
The aim of the PR is to make it possible to mount the local file system in a Node-enabled web page within Electron. Do you have other Emscripten issues within Electron?
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.