forked from Polymer/designer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelectron-main.js
39 lines (32 loc) · 1.37 KB
/
electron-main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @license
* Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
const {app, BrowserWindow} = require('electron');
// Report crashes to our server.
// require('crash-reporter').start();
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the javascript object is GCed.
var mainWindow = null;
// Quit when all windows are closed.
app.on('window-all-closed', () => {
if (process.platform != 'darwin') {
app.quit();
}
});
app.on('ready', () => {
mainWindow = new BrowserWindow({width: 1200, height: 800});
mainWindow.loadURL(`file://${__dirname}/electron-index.html`);
mainWindow.openDevTools();
mainWindow.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
});