Experimental electron support fixes
This commit is contained in:
@@ -17,10 +17,7 @@ function createWindow() {
|
|||||||
|
|
||||||
const indexPath = path.resolve(__dirname, '../dist/index.html');
|
const indexPath = path.resolve(__dirname, '../dist/index.html');
|
||||||
// and load the index.html of the app.
|
// and load the index.html of the app.
|
||||||
win.loadURL(`file://${indexPath}`)
|
win.loadURL(`file://${indexPath}`);
|
||||||
|
|
||||||
// Open the DevTools.
|
|
||||||
win.webContents.openDevTools()
|
|
||||||
|
|
||||||
// Emitted when the window is closed.
|
// Emitted when the window is closed.
|
||||||
win.on('closed', () => {
|
win.on('closed', () => {
|
||||||
@@ -28,13 +25,13 @@ function createWindow() {
|
|||||||
// in an array if your app supports multi windows, this is the time
|
// in an array if your app supports multi windows, this is the time
|
||||||
// when you should delete the corresponding element.
|
// when you should delete the corresponding element.
|
||||||
win = null;
|
win = null;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
// initialization and is ready to create browser windows.
|
// initialization and is ready to create browser windows.
|
||||||
// Some APIs can only be used after this event occurs.
|
// Some APIs can only be used after this event occurs.
|
||||||
app.on('ready', createWindow)
|
app.on('ready', createWindow);
|
||||||
|
|
||||||
// Quit when all windows are closed.
|
// Quit when all windows are closed.
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
@@ -43,7 +40,7 @@ app.on('window-all-closed', () => {
|
|||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
app.on('activate', () => {
|
app.on('activate', () => {
|
||||||
// On macOS it's common to re-create a window in the app when the
|
// On macOS it's common to re-create a window in the app when the
|
||||||
@@ -51,7 +48,7 @@ app.on('activate', () => {
|
|||||||
if (win === null) {
|
if (win === null) {
|
||||||
createWindow()
|
createWindow()
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
// In this file you can include the rest of your app's specific main process
|
// In this file you can include the rest of your app's specific main process
|
||||||
// code. You can also put them in separate files and require them here
|
// code. You can also put them in separate files and require them here
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
"name": "uhk-agent",
|
"name": "uhk-agent",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "Agent is the configuration application of the Ultimate Hacking Keyboard.",
|
"description": "Agent is the configuration application of the Ultimate Hacking Keyboard.",
|
||||||
"main": "electron/main.js",
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git@github.com:UltimateHackingKeyboard/agent.git"
|
"url": "git@github.com:UltimateHackingKeyboard/agent.git"
|
||||||
@@ -62,6 +61,6 @@
|
|||||||
"build": "gulp",
|
"build": "gulp",
|
||||||
"build:test": "webpack --config \"test-serializer/webpack.config.js\"",
|
"build:test": "webpack --config \"test-serializer/webpack.config.js\"",
|
||||||
"dev": "webpack-dev-server --config \"src/webpack.config.js\" --content-base \"./dist\"",
|
"dev": "webpack-dev-server --config \"src/webpack.config.js\" --content-base \"./dist\"",
|
||||||
"electron": "electron ."
|
"electron": "electron electron/index.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user