From 749560f3a8b7113ea1adeb5742c4dc3bc26cb7ad Mon Sep 17 00:00:00 2001 From: ocavue Date: Mon, 10 Oct 2022 19:43:36 +0800 Subject: [PATCH] fix(electron): disable sandbox to make electron-log work (#1143) --- .changeset/witty-ducks-complain.md | 5 +++++ packages/electron-main/src/window.ts | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/witty-ducks-complain.md diff --git a/.changeset/witty-ducks-complain.md b/.changeset/witty-ducks-complain.md new file mode 100644 index 000000000..a5fafd4be --- /dev/null +++ b/.changeset/witty-ducks-complain.md @@ -0,0 +1,5 @@ +--- +"@rino.app/electron": patch +--- + +Fix a desktop app crash. diff --git a/packages/electron-main/src/window.ts b/packages/electron-main/src/window.ts index 2ccd3e467..3df4b3421 100644 --- a/packages/electron-main/src/window.ts +++ b/packages/electron-main/src/window.ts @@ -41,6 +41,11 @@ export async function createWindow() { webPreferences: { preload: preloadEntry, + // Disable sandbox until we `electron-log` can be used in the + // preload script when sandbox is enable. See also + // https://github.com/megahertz/electron-log/issues/267 + sandbox: false, + // I need to disable web security in dev mode to load local image files // https://stackoverflow.com/a/50319258/9426588 webSecurity: !env.IS_DEV,