mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
more like untrustedtypes
This commit is contained in:
parent
92651ed66b
commit
6eb9b6f12c
5 changed files with 48 additions and 45 deletions
|
@ -27,6 +27,9 @@ export function encodeUrl(url: string | URL, origin?: URL) {
|
|||
);
|
||||
}
|
||||
|
||||
// is this the correct behavior?
|
||||
if (!url) url = origin.href;
|
||||
|
||||
if (url.startsWith("javascript:")) {
|
||||
return "javascript:" + rewriteJs(url.slice("javascript:".length));
|
||||
} else if (/^(#|mailto|about|data)/.test(url)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue