Skip to content

Instantly share code, notes, and snippets.

@etyp
Created June 21, 2016 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etyp/32eefdfa8990e2346c0dd923fca519e6 to your computer and use it in GitHub Desktop.
Save etyp/32eefdfa8990e2346c0dd923fca519e6 to your computer and use it in GitHub Desktop.
mainWindow = new BrowserWindow({
width: size.width < 1600 ? size.width - 50: size.width - 100,
height: size.width < 1600 ? size.height - 50: size.height - 100,
title: 'Hive: Home for busy teams',
/**
* Disable Electron's Node integration so that browser dependencies like `moment` will load themselves
* like normal i.e. into the window rather than into modules, and also to prevent untrusted client
* code from having access to the process and file system:
* - https://github.com/atom/electron/issues/254
* - https://github.com/atom/electron/issues/1753
*/
'web-preferences': {
'web-security': false,
nodeIntegration: false,
preload: path.join(__dirname, 'preload.js')
}
});
// Use new namespace for require so that
// normal js modules can use 'require' properly.
ElectronRequire = require;
delete require;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment