MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / onAppWebContentsCreated

Function onAppWebContentsCreated

src/main/Main.ts:387–397  ·  view source on GitHub ↗
(event: Electron.Event, webContents: Electron.WebContents)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

onMethod · 0.65

Tested by

no test coverage detected