mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 07:30:02 -04:00
more base jank
This commit is contained in:
parent
d864c0061a
commit
277d8c8ad9
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue