|
|
@ -96,9 +96,9 @@ function createWindow () {
|
|
|
|
event.returnValue = localeData;
|
|
|
|
event.returnValue = localeData;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// and load the index.html of the app.
|
|
|
|
function prepareURL(pathSegments) {
|
|
|
|
mainWindow.loadURL(url.format({
|
|
|
|
return url.format({
|
|
|
|
pathname: path.join(__dirname, 'background.html'),
|
|
|
|
pathname: path.join.apply(null, pathSegments),
|
|
|
|
protocol: 'file:',
|
|
|
|
protocol: 'file:',
|
|
|
|
slashes: true,
|
|
|
|
slashes: true,
|
|
|
|
query: {
|
|
|
|
query: {
|
|
|
@ -109,7 +109,14 @@ function createWindow () {
|
|
|
|
environment: environment,
|
|
|
|
environment: environment,
|
|
|
|
node_version: process.versions.node
|
|
|
|
node_version: process.versions.node
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}))
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV === 'test') {
|
|
|
|
|
|
|
|
mainWindow.loadURL(prepareURL([__dirname, 'test', 'index.html']));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
mainWindow.loadURL(prepareURL([__dirname, 'background.html']));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (config.get('openDevTools')) {
|
|
|
|
if (config.get('openDevTools')) {
|
|
|
|
// Open the DevTools.
|
|
|
|
// Open the DevTools.
|
|
|
|