Skip to content

Commit

Permalink
fix: baseURI
Browse files Browse the repository at this point in the history
Percslol committed Dec 21, 2024
1 parent daa2e34 commit cbd3fcd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/dom/element.ts
Original file line number Diff line number Diff line change
@@ -106,7 +106,9 @@ export default function (client: ScramjetClient, self: typeof window) {
client.Trap("Node.prototype.baseURI", {
get(ctx) {
const node = ctx.this as Node;
const base = node.ownerDocument.querySelector("base");
let base = node.ownerDocument?.querySelector("base");
if (node instanceof Document) base = node.querySelector("base");

if (base) {
return new URL(base.href, client.url.origin).href;
}

0 comments on commit cbd3fcd

Please sign in to comment.