feat(apps): allow custom URI schemes in application links

Remove URL validation from app href field to support custom URI
schemes like vscode://, microsoft-edge:https://, and myapp://open.
Only javascript: URIs remain blocked for security.

Closes #6520
This commit is contained in:
ajnart committed 2026-08-05 14:25:53 +02:00
1 parent 778533a62e
commit 00fad39792
3 files changed
+8 -7

No files matched your search

+1 -2
View File
@@ -3,8 +3,7 @@ import { z } from "zod/v4";
export const appHrefSchema = z
.string()
.trim()
.url()
.regex(/^(?!javascript)[a-zA-Z]*:\/\//i) // javascript: is not allowed, i for case insensitive (so Javascript: is also not allowed)
.refine((val) => !/^javascript:/i.test(val), "JavaScript URIs are not permitted")
.or(z.literal(""))
.transform((value) => (value.length === 0 ? null : value))
.nullable();