Created
November 12, 2016 20:48
-
-
Save Balamir/35628b30ff218ae85f38f5092d9a61d8 to your computer and use it in GitHub Desktop.
JS: isElectron ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var isElectron = (window && window.process && window.process.type === 'renderer'); | |
| if (isElectron) { | |
| // keep Electron's require so we can load its modules | |
| window.electronRequire = window.require; | |
| window.electronModule = window.module; | |
| // clear window.require so Ember can load if wrapped in Electron | |
| // issue explained on https://github.com/atom/electron/issues/303 | |
| window.require = undefined; | |
| window.module = undefined; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment