Added event handles for potential problems devtron showed and log these to console
This commit is contained in:
13
src/main.js
13
src/main.js
@@ -11,6 +11,10 @@ const {
|
||||
systemPreferences
|
||||
} = require('electron');
|
||||
|
||||
process.on('uncaughtException', (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
var cmd = process.argv[1];
|
||||
if (cmd === '--squirrel-uninstall') {
|
||||
@@ -299,6 +303,15 @@ app.on('ready', function() {
|
||||
}
|
||||
window_options.title = app.getName();
|
||||
mainWindow = new BrowserWindow(window_options);
|
||||
|
||||
mainWindow.webContents.on('crashed', () => {
|
||||
console.log('The application has crashed.');
|
||||
});
|
||||
|
||||
mainWindow.on('unresponsive', () => {
|
||||
console.log('The application has become unresponsive.')
|
||||
});
|
||||
|
||||
mainWindow.setFullScreenable(true); // fullscreenable option has no effect.
|
||||
if (window_options.maximized) {
|
||||
mainWindow.maximize();
|
||||
|
Reference in New Issue
Block a user