diff --git a/frontend/__tests__/root/config.spec.ts b/frontend/__tests__/root/config.spec.ts index d75583bc9..dc7ce4a70 100644 --- a/frontend/__tests__/root/config.spec.ts +++ b/frontend/__tests__/root/config.spec.ts @@ -751,7 +751,7 @@ describe("Config", () => { Config.setCustomBackground(" http://example.com/test.png ") ).toBe(true); - expect(Config.setCustomBackground("http://www.example.com/test.webp")).toBe( + expect(Config.setCustomBackground("http://www.example.com/test.tiff")).toBe( false ); expect( diff --git a/frontend/src/html/pages/settings.html b/frontend/src/html/pages/settings.html index 07e3dc4c6..28fb1dace 100644 --- a/frontend/src/html/pages/settings.html +++ b/frontend/src/html/pages/settings.html @@ -1376,7 +1376,7 @@ diff --git a/frontend/src/ts/commandline/lists/custom-background.ts b/frontend/src/ts/commandline/lists/custom-background.ts index 90ff0a8a2..75c91afb4 100644 --- a/frontend/src/ts/commandline/lists/custom-background.ts +++ b/frontend/src/ts/commandline/lists/custom-background.ts @@ -42,7 +42,7 @@ const customBackgroundCommand: Command = { } // check type - if (!file.type.match(/image\/(jpeg|jpg|png|gif)/)) { + if (!file.type.match(/image\/(jpeg|jpg|png|gif|webp)/)) { Notifications.add("Unsupported image format", 0); cleanup(); return; diff --git a/frontend/src/ts/elements/settings/custom-background-picker.ts b/frontend/src/ts/elements/settings/custom-background-picker.ts index 6cd3132ff..17daad85c 100644 --- a/frontend/src/ts/elements/settings/custom-background-picker.ts +++ b/frontend/src/ts/elements/settings/custom-background-picker.ts @@ -52,7 +52,7 @@ uploadContainerEl } // check type - if (!file.type.match(/image\/(jpeg|jpg|png|gif)/)) { + if (!file.type.match(/image\/(jpeg|jpg|png|gif|webp)/)) { Notifications.add("Unsupported image format", 0); fileInput.value = ""; return; diff --git a/packages/schemas/src/configs.ts b/packages/schemas/src/configs.ts index aae692503..c5f6ebbe7 100644 --- a/packages/schemas/src/configs.ts +++ b/packages/schemas/src/configs.ts @@ -345,7 +345,7 @@ export const CustomBackgroundSchema = z .url("Needs to be an URI.") .regex(/^(https|http):\/\/.*/, "Unsupported protocol.") .regex(/^[^`'"]*$/, "May not contain quotes.") - .regex(/.+(\.png|\.gif|\.jpeg|\.jpg)/gi, "Unsupported image format.") + .regex(/.+(\.png|\.gif|\.jpeg|\.jpg|\.webp)/gi, "Unsupported image format.") .max(2048, "URL is too long.") .or(z.literal("")); export type CustomBackground = z.infer;