From 1fb2db86c00cbe803303e472c485691a1de4a1e3 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Thu, 14 May 2026 08:25:36 +0800 Subject: [PATCH 1/2] ! Fix "replace http cache" not working in dev --- src/main/index.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 771cfed5037ac..3771774f981d7 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -65,6 +65,15 @@ function runApp() { ? new Set(__FREETUBE_ALLOWED_PATHS__) : new Set() + protocol.registerSchemesAsPrivileged([ + { + scheme: 'imagecache', + privileges: { + secure: true, + corsEnabled: true + } + }, + ]) if (process.env.NODE_ENV === 'production') { protocol.registerSchemesAsPrivileged([ { @@ -74,13 +83,6 @@ function runApp() { secure: true, supportFetchAPI: true } - }, - { - scheme: 'imagecache', - privileges: { - secure: true, - corsEnabled: true - } } ]) } From c54f2e259ea1fd6e60e235ce0aca8036cebdebd7 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Thu, 14 May 2026 17:25:18 +0800 Subject: [PATCH 2/2] ! Fix implementation for production since registerSchemesAsPrivileged can be called once only --- src/main/index.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 3771774f981d7..52b9de779fd17 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -73,19 +73,17 @@ function runApp() { corsEnabled: true } }, + ...(process.env.NODE_ENV === 'production' + ? [{ + scheme: 'app', + privileges: { + standard: true, + secure: true, + supportFetchAPI: true + } + }] + : []), ]) - if (process.env.NODE_ENV === 'production') { - protocol.registerSchemesAsPrivileged([ - { - scheme: 'app', - privileges: { - standard: true, - secure: true, - supportFetchAPI: true - } - } - ]) - } const ROOT_APP_URL = process.env.NODE_ENV === 'development' ? 'http://localhost:9080' : 'app://bundle/index.html'