[ABS] Update spec and wgt files
[profile/tv/apps/web/webapp-addon-setting.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({
25     width: 800,
26     height: 600,
27     webPreferences: {
28       nodeIntegration: true
29     }
30   });
31
32   // and load the index.html of the app.
33   mainWindow.loadURL('file://' + __dirname + '/index.html');
34
35   // Open the DevTools.
36   //mainWindow.openDevTools();
37
38   // Emitted when the window is closed.
39   mainWindow.on('closed', function() {
40     // Dereference the window object, usually you would store windows
41     // in an array if your app supports multi windows, this is the time
42     // when you should delete the corresponding element.
43     mainWindow = null;
44   });
45 });