| 385 | } |
| 386 | |
| 387 | function onAppWebContentsCreated(event: Electron.Event, webContents: Electron.WebContents): void { |
| 388 | // Open links to web pages in the OS-es default browser |
| 389 | // (instead of navigating to it with the electron window that opened it) |
| 390 | webContents.on('will-navigate', onNewPage); |
| 391 | webContents.on('new-window', onNewPage); |
| 392 | |
| 393 | function onNewPage(event: Electron.Event, navigationUrl: string): void { |
| 394 | event.preventDefault(); |
| 395 | shell.openExternal(navigationUrl); |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | function onAppActivate(): void { |
| 400 | // On OS X it's common to re-create a window in the app when the |