don't put file path in custom url protocol

This commit is contained in:
ading2210 2024-01-23 19:00:06 -08:00
parent 9ff6653503
commit f7da64a0ed
2 changed files with 4 additions and 5 deletions

View file

@ -25,7 +25,7 @@ if (IS_DEV) {
process.env.VENCORD_USER_DATA_DIR = DATA_DIR; process.env.VENCORD_USER_DATA_DIR = DATA_DIR;
function init() { function init() {
const { disableSmoothScroll, hardwareAcceleration } = Settings.store; const { disableSmoothScroll, hardwareAcceleration, splashAnimationPath } = Settings.store;
if (hardwareAcceleration === false) app.disableHardwareAcceleration(); if (hardwareAcceleration === false) app.disableHardwareAcceleration();
if (disableSmoothScroll) { if (disableSmoothScroll) {
@ -64,9 +64,8 @@ function init() {
registerMediaPermissionsHandler(); registerMediaPermissionsHandler();
//register file handler so we can load the custom splash animation from the user's filesystem //register file handler so we can load the custom splash animation from the user's filesystem
protocol.registerFileProtocol("image", (request, callback) => { protocol.registerFileProtocol("splash-animation", (request, callback) => {
const url = request.url.substring(8); callback({path: splashAnimationPath});
callback({path: url});
}); });
bootstrap(); bootstrap();

View file

@ -37,7 +37,7 @@ export function createSplashWindow(startMinimized = false) {
if (splashAnimationPath) { if (splashAnimationPath) {
splash.webContents.executeJavaScript(` splash.webContents.executeJavaScript(`
document.getElementById("animation").src = "image://${splashAnimationPath}"; document.getElementById("animation").src = "splash-animation://img";
`); `);
} }
else { else {