export class App { static onMessage() { const app = require('electron').app; app.on('window-all-closed', function () { // On OS X it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== 'darwin') { app.quit() } }); app.on('before-quit', function () { //可以调用event.preventDefault默认事件来阻止应用程序的默认行为 }); app.on('browser-window-blur', function () { }); app.on('browser-window-focus', function () { }); app.on('browser-window-created', function () { }); } }