WebApp Addon Setting App
[scm/test2.git] / main.js
1 const {app, BrowserWindow} = require('electron');  // Module to control application life.
2 console.log('ElectronExtensionManager');
3 // Report crashes to our server.
4 //require('crash-reporter').start();
5
6 // Keep a global reference of the window object, if you don't, the window will
7 // be closed automatically when the JavaScript object is garbage collected.
8 var mainWindow = null;
9
10 // Quit when all windows are closed.
11 app.on('window-all-closed', function() {
12   // On OS X it is common for applications and their menu bar
13   // to stay active until the user quits explicitly with Cmd + Q
14   if (process.platform != 'darwin') {
15     app.quit();
16   }
17 });
18
19 // This method will be called when Electron has finished
20 // initialization and is ready to create browser windows.
21 app.on('ready', function() {
22   console.log('ready');
23   // Create the browser window.
24   mainWindow = new BrowserWindow({width: 800, height: 600});
25
26   // and load the index.html of the app.
27   mainWindow.loadURL('file://' + __dirname + '/index.html');
28
29   // Open the DevTools.
30   //mainWindow.openDevTools();
31
32   // Emitted when the window is closed.
33   mainWindow.on('closed', function() {
34     // Dereference the window object, usually you would store windows
35     // in an array if your app supports multi windows, this is the time
36     // when you should delete the corresponding element.
37     mainWindow = null;
38   });
39 });