diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2022-04-18 01:56:59 -0500 |
---|---|---|
committer | Vijay Aravamudhan <vraravam@users.noreply.github.com> | 2022-04-19 10:07:50 +0400 |
commit | d15680096e6e3c1b6e9f13a8b07d3f97d56060c9 (patch) | |
tree | 00816de4fc3701dc58f757a09083042082adbbcc /src/index.ts | |
parent | Pulled in rebranded recipes submodule (diff) | |
download | ferdium-app-d15680096e6e3c1b6e9f13a8b07d3f97d56060c9.tar.gz ferdium-app-d15680096e6e3c1b6e9f13a8b07d3f97d56060c9.tar.zst ferdium-app-d15680096e6e3c1b6e9f13a8b07d3f97d56060c9.zip |
Upgrade electron to '16.2.2'
Remove deprecated 'webPreference' flag
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/index.ts b/src/index.ts index c61523584..013cf93ce 100644 --- a/src/index.ts +++ b/src/index.ts | |||
@@ -13,7 +13,7 @@ import { emptyDirSync, ensureFileSync } from 'fs-extra'; | |||
13 | import { join } from 'path'; | 13 | import { join } from 'path'; |
14 | import windowStateKeeper from 'electron-window-state'; | 14 | import windowStateKeeper from 'electron-window-state'; |
15 | import ms from 'ms'; | 15 | import ms from 'ms'; |
16 | import { initializeRemote } from './electron-util'; | 16 | import { enableWebContents, initializeRemote } from './electron-util'; |
17 | import { enforceMacOSAppLocation } from './enforce-macos-app-location'; | 17 | import { enforceMacOSAppLocation } from './enforce-macos-app-location'; |
18 | 18 | ||
19 | initializeRemote(); | 19 | initializeRemote(); |
@@ -214,13 +214,18 @@ const createWindow = () => { | |||
214 | webviewTag: true, | 214 | webviewTag: true, |
215 | preload: join(__dirname, 'sentry.js'), | 215 | preload: join(__dirname, 'sentry.js'), |
216 | nativeWindowOpen: true, | 216 | nativeWindowOpen: true, |
217 | // @ts-expect-error Object literal may only specify known properties, and 'enableRemoteModule' does not exist in type 'WebPreferences'. | ||
218 | enableRemoteModule: true, | ||
219 | }, | 217 | }, |
220 | }); | 218 | }); |
221 | 219 | ||
220 | enableWebContents(mainWindow.webContents); | ||
221 | |||
222 | app.on('browser-window-created', (_, window) => { | ||
223 | enableWebContents(window.webContents); | ||
224 | }); | ||
225 | |||
222 | app.on('web-contents-created', (_e, contents) => { | 226 | app.on('web-contents-created', (_e, contents) => { |
223 | if (contents.getType() === 'webview') { | 227 | if (contents.getType() === 'webview') { |
228 | enableWebContents(contents); | ||
224 | contents.on('new-window', event => { | 229 | contents.on('new-window', event => { |
225 | event.preventDefault(); | 230 | event.preventDefault(); |
226 | }); | 231 | }); |
@@ -523,6 +528,7 @@ ipcMain.on('open-browser-window', (_e, { url, serviceId }) => { | |||
523 | nativeWindowOpen: true, | 528 | nativeWindowOpen: true, |
524 | }, | 529 | }, |
525 | }); | 530 | }); |
531 | enableWebContents(child.webContents); | ||
526 | child.show(); | 532 | child.show(); |
527 | child.loadURL(url); | 533 | child.loadURL(url); |
528 | debug('Received open-browser-window', url); | 534 | debug('Received open-browser-window', url); |