Added event handles for potential problems devtron showed and log these to console

This commit is contained in:
Kolja Lampe
2016-07-04 09:39:42 +02:00
parent 8637177c57
commit bbea5e570e
2 changed files with 14 additions and 0 deletions

View File

@@ -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();