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;
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();

View file

@ -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 {