emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

Possible improvements to env detection?

Open paulshapiro opened this issue 8 years ago • 2 comments

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;

paulshapiro avatar Jul 23 '18 01:07 paulshapiro

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?

ericmandel avatar May 16 '19 00:05 ericmandel

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.

stale[bot] avatar May 15 '20 01:05 stale[bot]