From f7da64a0edf8aaacc6bb01ea85654c5b6c861507 Mon Sep 17 00:00:00 2001 From: ading2210 Date: Tue, 23 Jan 2024 19:00:06 -0800 Subject: [PATCH] don't put file path in custom url protocol --- src/main/index.ts | 7 +++---- src/main/splash.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index 780d52a..6484d70 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -25,7 +25,7 @@ if (IS_DEV) { process.env.VENCORD_USER_DATA_DIR = DATA_DIR; function init() { - const { disableSmoothScroll, hardwareAcceleration } = Settings.store; + const { disableSmoothScroll, hardwareAcceleration, splashAnimationPath } = Settings.store; if (hardwareAcceleration === false) app.disableHardwareAcceleration(); if (disableSmoothScroll) { @@ -64,9 +64,8 @@ function init() { registerMediaPermissionsHandler(); //register file handler so we can load the custom splash animation from the user's filesystem - protocol.registerFileProtocol("image", (request, callback) => { - const url = request.url.substring(8); - callback({path: url}); + protocol.registerFileProtocol("splash-animation", (request, callback) => { + callback({path: splashAnimationPath}); }); bootstrap(); diff --git a/src/main/splash.ts b/src/main/splash.ts index 1d1df1b..e88f0ce 100644 --- a/src/main/splash.ts +++ b/src/main/splash.ts @@ -37,7 +37,7 @@ export function createSplashWindow(startMinimized = false) { if (splashAnimationPath) { splash.webContents.executeJavaScript(` - document.getElementById("animation").src = "image://${splashAnimationPath}"; + document.getElementById("animation").src = "splash-animation://img"; `); } else {