From 12f2c4010261d7615d7290b62540c793354f8e34 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 7 Sep 2018 09:05:30 -0400 Subject: #701 initial code --- electron_js/main.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'electron_js/main.js') diff --git a/electron_js/main.js b/electron_js/main.js index 2d2f4ec4..efac0235 100644 --- a/electron_js/main.js +++ b/electron_js/main.js @@ -2,6 +2,8 @@ const electron = require('electron'); const windowStateKeeper = require('electron-window-state'); const {app, globalShortcut, Menu} = electron; const {dialog} = require('electron') +const path = require('path'); +const url = require('url'); // Module to create native browser window. const {BrowserWindow} = electron; @@ -98,7 +100,15 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { } // and load the index.html of the app. - win.loadURL(`file://${__dirname}/index.html`); + + const startUrl = process.env.ELECTRON_START_URL || url.format({ + pathname: path.join(__dirname, '/../www/index.html'), + protocol: 'file:', + slashes: true + }); + + win.loadURL(startUrl); + //win.loadURL(`file://${__dirname}/index.html`); // Create the Application's main menu -- cgit v1.2.3