From ab5eb356c404988ef3cc1be7a5a9de436346e6a7 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Mon, 27 Sep 2021 11:32:37 +0300 Subject: [PATCH] Electron 13.4.0 (#3820) * electron 13.4.0 Signed-off-by: Jari Kolehmainen * electron 13.4.0 Signed-off-by: Jari Kolehmainen * refactor deprecated window event handler Signed-off-by: Jari Kolehmainen --- .yarnrc | 2 +- package.json | 2 +- src/main/window-manager.ts | 8 ++++---- yarn.lock | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.yarnrc b/.yarnrc index 9f7a2e491b..3666616e0b 100644 --- a/.yarnrc +++ b/.yarnrc @@ -1,3 +1,3 @@ disturl "https://atom.io/download/electron" -target "12.0.15" +target "13.4.0" runtime "electron" diff --git a/package.json b/package.json index 64f4476423..6b19e77edc 100644 --- a/package.json +++ b/package.json @@ -327,7 +327,7 @@ "css-loader": "^5.2.6", "deepdash": "^5.3.5", "dompurify": "^2.3.1", - "electron": "^12.0.17", + "electron": "^13.4.0", "electron-builder": "^22.11.11", "electron-notarize": "^0.3.0", "esbuild": "^0.12.24", diff --git a/src/main/window-manager.ts b/src/main/window-manager.ts index 80e3224fd4..f751d79790 100644 --- a/src/main/window-manager.ts +++ b/src/main/window-manager.ts @@ -109,10 +109,6 @@ export class WindowManager extends Singleton { app.dock?.hide(); // hide icon in dock (mac-os) }) .webContents - .on("new-window", (event, url) => { - event.preventDefault(); - shell.openExternal(url); - }) .on("dom-ready", () => { appEventBus.emit({ name: "app", action: "dom-ready" }); }) @@ -150,6 +146,10 @@ export class WindowManager extends Singleton { // Always disable Node.js integration for all webviews webPreferences.nodeIntegration = false; + }).setWindowOpenHandler((details) => { + shell.openExternal(details.url); + + return { action: "deny" }; }); } diff --git a/yarn.lock b/yarn.lock index e5ea295dd7..8150be76a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5268,10 +5268,10 @@ electron-window-state@^5.0.3: jsonfile "^4.0.0" mkdirp "^0.5.1" -electron@^12.0.17: - version "12.0.17" - resolved "https://registry.yarnpkg.com/electron/-/electron-12.0.17.tgz#9707c9bfd0a29ae63b8b66f1b3acf8894f7b63f4" - integrity sha512-jkOMKSEj/X9i++5LD7NKqYK/ORi6H0kHYk6rrvcJNQfbDpYX5lxNNexZ2ikPeKxS2B84+WcSFrw5Ce9y8B+pmA== +electron@^13.4.0: + version "13.4.0" + resolved "https://registry.yarnpkg.com/electron/-/electron-13.4.0.tgz#f9f9e518d8c6bf23bfa8b69580447eea3ca0f880" + integrity sha512-KJGWS2qa0xZXIMPMDUNkRVO8/JxRd4+M0ejYYOzu2LIQ5ijecPzNuNR9nvDkml9XyyRBzu975FkhJcwD17ietQ== dependencies: "@electron/get" "^1.0.1" "@types/node" "^14.6.2"