mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -04:00
decodeUrl for blobbed workers
This commit is contained in:
parent
7289a329c4
commit
c0c3dd1f0d
1 changed files with 7 additions and 0 deletions
|
@ -51,6 +51,13 @@ export function decodeUrl(url: string | URL) {
|
||||||
url = url.href;
|
url = url.href;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
URL.canParse(url) &&
|
||||||
|
new URL(url).pathname.startsWith(self.$scramjet.config.prefix + "worker")
|
||||||
|
) {
|
||||||
|
return new URL(new URL(url).searchParams.get("origin"));
|
||||||
|
}
|
||||||
|
|
||||||
if (/^(#|about|data|mailto|javascript)/.test(url)) {
|
if (/^(#|about|data|mailto|javascript)/.test(url)) {
|
||||||
return url;
|
return url;
|
||||||
} else if (canParseUrl(url)) {
|
} else if (canParseUrl(url)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue