Skip to content

Instantly share code, notes, and snippets.

@Balamir
Created November 12, 2016 20:48
Show Gist options
  • Select an option

  • Save Balamir/35628b30ff218ae85f38f5092d9a61d8 to your computer and use it in GitHub Desktop.

Select an option

Save Balamir/35628b30ff218ae85f38f5092d9a61d8 to your computer and use it in GitHub Desktop.
JS: isElectron ?
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