electron#Event TypeScript Examples
The following examples show how to use
electron#Event.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: main.ts From noteworthy with GNU Affero General Public License v3.0 | 5 votes |
__close = (event: Event) => {
console.log("main :: __close");
// when this is true, the app has decided it's OK to quit
if (global.isQuitting) { return; }
// otherwise, we need to decide whether it's OK to quit
event.preventDefault();
this._app.handle("lifecycle", "requestAppQuit");
}
Example #2
Source File: main.ts From noteworthy with GNU Affero General Public License v3.0 | 5 votes |
__navigateUrl = (event:Event, url:string) => {
if (url === this.window.webContents.getURL()) { return; }
event.preventDefault();
shell.openExternal(url);
}
Example #3
Source File: main.ts From desktop with MIT License | 5 votes |
app.on(`window-all-closed`, (event: Event) => {
// Don't quit when all windows are closed
event.preventDefault()
trackEvent(`WINDOW_CLOSE`)
})