From ec3eacbf94a4d5552cfd80ed99834b7225259de6 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 25 May 2018 13:09:14 -0700 Subject: [PATCH] update index loading for new API --- main.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/main.js b/main.js index 07561fa..1598373 100644 --- a/main.js +++ b/main.js @@ -1,11 +1,5 @@ -const electron = require('electron') -// Module to control application life. -const app = electron.app -// Module to create native browser window. -const BrowserWindow = electron.BrowserWindow - -const path = require('path') -const url = require('url') +// Modules to control application life and create native browser window +const {app, BrowserWindow} = require('electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -16,11 +10,7 @@ function createWindow () { mainWindow = new BrowserWindow({width: 800, height: 600}) // and load the index.html of the app. - mainWindow.loadURL(url.format({ - pathname: path.join(__dirname, 'index.html'), - protocol: 'file:', - slashes: true - })) + mainWindow.loadFile('index.html') // Open the DevTools. // mainWindow.webContents.openDevTools()