From 815341d5e895e26e25d0de7780d3130b6bcc80bb Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Sun, 22 Mar 2026 19:07:47 +0100 Subject: [PATCH] fix(electron): explicitly disable sandbox for preload script compatibility The preload script uses require() for local modules which is not supported in Electron's sandboxed preload environment (default since Electron 20). This only affects Electron's preload API restrictions, not Chromium's OS-level process sandbox which remains active. --- electron/main-window.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/electron/main-window.ts b/electron/main-window.ts index 0b1a4af1d8..b94ff5910c 100644 --- a/electron/main-window.ts +++ b/electron/main-window.ts @@ -124,6 +124,10 @@ export const createWindow = async ({ webSecurity: false, preload: path.join(__dirname, 'preload.js'), nodeIntegration: false, + // Required: preload.js uses require() for local modules (e.g. ./shared-with-frontend/ipc-events.const). + // Electron 20+ defaults sandbox to true, and sandboxed preloads can only require built-in Electron + // modules. This does NOT disable Chromium's OS-level process sandbox (that's --no-sandbox). + sandbox: false, // make remote module work with those two settings contextIsolation: true, // Additional settings for better Linux/Wayland compatibility