From 82f9c807c16328ebf150f3a6d0e061cbad8948af Mon Sep 17 00:00:00 2001 From: Juan Irache Date: Thu, 1 Jun 2023 21:14:55 +0200 Subject: [PATCH 1/3] Avoid crash with electron 26 Not sure of the side effects of this --- src/common/module-names.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/module-names.ts b/src/common/module-names.ts index 0217f67..c4976ae 100644 --- a/src/common/module-names.ts +++ b/src/common/module-names.ts @@ -46,9 +46,9 @@ export const browserModuleNames = [ const features = getElectronBinding('features'); -if (!features || features.isDesktopCapturerEnabled()) { +/* if (!features || features.isDesktopCapturerEnabled()) { browserModuleNames.push('desktopCapturer'); -} +} */ if (!features || features.isViewApiEnabled()) { browserModuleNames.push('ImageView'); From 10e02d5711620032d8c7df6554a1e6b3f2e6d293 Mon Sep 17 00:00:00 2001 From: Juan Irache Date: Fri, 2 Jun 2023 00:15:52 +0200 Subject: [PATCH 2/3] Checking isDesktopCapturerEnabled is no longer necessary or possible. Fixes #153 Context https://github.com/electron/electron/pull/38412 --- src/common/module-names.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/common/module-names.ts b/src/common/module-names.ts index c4976ae..7818420 100644 --- a/src/common/module-names.ts +++ b/src/common/module-names.ts @@ -15,6 +15,7 @@ export const browserModuleNames = [ 'contentTracing', 'crashReporter', 'dialog', + 'desktopCapturer', 'globalShortcut', 'ipcMain', 'inAppPurchase', @@ -46,10 +47,6 @@ export const browserModuleNames = [ const features = getElectronBinding('features'); -/* if (!features || features.isDesktopCapturerEnabled()) { - browserModuleNames.push('desktopCapturer'); -} */ - if (!features || features.isViewApiEnabled()) { browserModuleNames.push('ImageView'); } From 9bd92e8306be7f4c717a9ef3951d3afb60b8ae7d Mon Sep 17 00:00:00 2001 From: Juan Irache Date: Fri, 2 Jun 2023 09:30:31 +0200 Subject: [PATCH 3/3] Revert to checking isDesktopCapturerEnabled for pre-26 electron versions --- src/common/module-names.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/module-names.ts b/src/common/module-names.ts index 7818420..f14676f 100644 --- a/src/common/module-names.ts +++ b/src/common/module-names.ts @@ -15,7 +15,6 @@ export const browserModuleNames = [ 'contentTracing', 'crashReporter', 'dialog', - 'desktopCapturer', 'globalShortcut', 'ipcMain', 'inAppPurchase', @@ -47,6 +46,10 @@ export const browserModuleNames = [ const features = getElectronBinding('features'); +if (!features || !features.isDesktopCapturerEnabled || features.isDesktopCapturerEnabled()) { + browserModuleNames.push('desktopCapturer'); +} + if (!features || features.isViewApiEnabled()) { browserModuleNames.push('ImageView'); }