{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/3379","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/3379/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/3379/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/3379/events","html_url":"https://github.com/kripken/emscripten/issues/3379","id":69932245,"number":3379,"title":"ENVIRONMENT_IS_NODE is a false positive in browserify","user":{"login":"fabiosantoscode","id":1611595,"avatar_url":"https://avatars.githubusercontent.com/u/1611595?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiosantoscode","html_url":"https://github.com/fabiosantoscode","followers_url":"https://api.github.com/users/fabiosantoscode/followers","following_url":"https://api.github.com/users/fabiosantoscode/following{/other_user}","gists_url":"https://api.github.com/users/fabiosantoscode/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiosantoscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiosantoscode/subscriptions","organizations_url":"https://api.github.com/users/fabiosantoscode/orgs","repos_url":"https://api.github.com/users/fabiosantoscode/repos","events_url":"https://api.github.com/users/fabiosantoscode/events{/privacy}","received_events_url":"https://api.github.com/users/fabiosantoscode/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-21T19:35:49Z","updated_at":"2015-07-12T23:24:06Z","closed_at":"2015-04-22T17:47:48Z","body":"When using browserify, this flag in the generated code will be set to true, since there is indeed a `process` variable.\r\n\r\nThe problem with this is that `process` variable is a shim, and it doesn't have a lot of features it has in node.\r\n\r\nThe `ENVIRONMENT_IS_NODE` flag should be false when in the presence of a `window` object.\r\n\r\nEmscripten should still export to module.exports if it's present, but that's another issue.\r\n\r\nThanks for your work on this awesome project!\r\n\r\nSee defunctzombie/node-process#40"},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/120772407","html_url":"https://github.com/kripken/emscripten/issues/3379#issuecomment-120772407","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/3379","id":120772407,"user":{"login":"fabiosantoscode","id":1611595,"avatar_url":"https://avatars.githubusercontent.com/u/1611595?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiosantoscode","html_url":"https://github.com/fabiosantoscode","followers_url":"https://api.github.com/users/fabiosantoscode/followers","following_url":"https://api.github.com/users/fabiosantoscode/following{/other_user}","gists_url":"https://api.github.com/users/fabiosantoscode/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiosantoscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiosantoscode/subscriptions","organizations_url":"https://api.github.com/users/fabiosantoscode/orgs","repos_url":"https://api.github.com/users/fabiosantoscode/repos","events_url":"https://api.github.com/users/fabiosantoscode/events{/privacy}","received_events_url":"https://api.github.com/users/fabiosantoscode/received_events","type":"User","site_admin":false},"created_at":"2015-07-12T23:24:06Z","updated_at":"2015-07-12T23:24:06Z","body":"(sorry for the late reply, my inbox is flooding!)\r\n\r\nI don't think we should count on importScripts just being present in the browser. There are some web-worker emulation modules in nodeJS that attempt to be isomorphic by emulating the standard API.\r\n\r\nHow about checking `navigator` instead of `window`?"}}