diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-09-07 09:05:30 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-09-07 09:05:30 -0400 |
| commit | 12f2c4010261d7615d7290b62540c793354f8e34 (patch) | |
| tree | 805e8889f1fe86a386333217b5d366fb15d3727f /electron_js | |
| parent | 17ce2311225b7d6794b0a65ce9bf87b68958f5df (diff) | |
#701 initial code
Diffstat (limited to 'electron_js')
| -rw-r--r-- | electron_js/main.js | 12 | ||||
| -rw-r--r-- | electron_js/package.json | 2 |
2 files changed, 12 insertions, 2 deletions
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 diff --git a/electron_js/package.json b/electron_js/package.json index bcab2f07..def2632f 100644 --- a/electron_js/package.json +++ b/electron_js/package.json @@ -1,5 +1,5 @@ { "name" : "zmNinjaDesktop", "version" : "0.1.0", - "main" : "main.js" + "main" : "./main.js" } |
