| 91 | } |
| 92 | |
| 93 | function onAppWebContentsCreated(event: Electron.Event, webContents: Electron.WebContents): void { |
| 94 | // Open links to web pages in the OS-es default browser |
| 95 | // (instead of navigating to it with the electron window that opened it) |
| 96 | webContents.on('will-navigate', onNewPage); |
| 97 | webContents.on('new-window', onNewPage); |
| 98 | |
| 99 | function onNewPage(event: Electron.Event, navigationUrl: string): void { |
| 100 | event.preventDefault(); |
| 101 | shell.openExternal(navigationUrl); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | function onAppActivate(): void { |
| 106 | // On OS X it's common to re-create a window in the app when the |