more base jank

This commit is contained in:
velzie 2024-09-03 10:44:28 -04:00
parent d864c0061a
commit 277d8c8ad9
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F

View file

@ -120,7 +120,11 @@ export class ScramjetClient {
if (iswindow) {
const base = client.global.document.querySelector("base");
if (base) {
return new URL(base.getAttribute(`href`), client.url.origin);
let url = base.getAttribute(`href`);
let frag = url.indexOf("#");
url = url.substring(0, frag === -1 ? undefined : frag);
if (!url) return client.url;
return new URL(url, client.url.origin);
}
}
return client.url;