Skip to content

Commit

Permalink
Format URL passed to BrowserWindow.loadURL
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsawicki committed Oct 31, 2016
1 parent 85e575a commit 995d109
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const app = electron.app
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow

const url = require('url')

// 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.
let mainWindow
Expand All @@ -13,7 +15,11 @@ function createWindow () {
mainWindow = new BrowserWindow({width: 800, height: 600})

// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/index.html`)
mainWindow.loadURL(url.format({
pathname: __dirname + '/index.html',
protocol: 'file:',
slashes: true
}))

// Open the DevTools.
mainWindow.webContents.openDevTools()
Expand Down

0 comments on commit 995d109

Please sign in to comment.