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

Function onAppWebContentsCreated

src/main/BrowserMode.ts:93–103  ·  view source on GitHub ↗
(event: Electron.Event, webContents: Electron.WebContents)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

onMethod · 0.65

Tested by

no test coverage detected