electron/default_app/default_app.js

34 lines
787 B
JavaScript
Raw Normal View History

const {app, BrowserWindow, crashReporter} = require('electron')
2016-07-06 11:47:21 -07:00
const path = require('path')
2016-07-06 11:47:21 -07:00
let mainWindow = null
// Quit when all windows are closed.
app.on('window-all-closed', () => {
app.quit()
})
exports.load = (appUrl) => {
app.on('ready', () => {
2016-07-06 11:47:21 -07:00
const options = {
width: 800,
height: 600,
autoHideMenuBar: true,
2016-04-26 09:25:46 -07:00
backgroundColor: '#FFFFFF',
2016-03-27 10:38:32 -07:00
useContentSize: true
2016-07-06 11:47:21 -07:00
}
if (process.platform === 'linux') {
options.icon = path.join(__dirname, 'icon.png')
}
crashReporter.start({
2016-12-12 21:32:58 -08:00
submitURL: 'http://localhost:8080/uploadDump/mainDump',
companyName: 'Main Company',
productName: 'Main Product'
})
2016-07-06 11:47:21 -07:00
mainWindow = new BrowserWindow(options)
mainWindow.loadURL(appUrl)
mainWindow.focus()
})
}