From 9879199d27a34d683e2edf95e9092e04748b3503 Mon Sep 17 00:00:00 2001 From: Percs <83934299+Percslol@users.noreply.github.com> Date: Sat, 12 Oct 2024 02:44:35 -0500 Subject: [PATCH] fix: node not returning proper value --- src/client/dom/element.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/client/dom/element.ts b/src/client/dom/element.ts index 05a587b..b207a73 100644 --- a/src/client/dom/element.ts +++ b/src/client/dom/element.ts @@ -52,7 +52,7 @@ export default function (client: ScramjetClient, self: typeof window) { for (const element of attrObject[attr]) { const descriptor = nativeGetOwnPropertyDescriptor( element.prototype, - attr, + attr ); Object.defineProperty(element.prototype, attr, { get() { @@ -80,7 +80,7 @@ export default function (client: ScramjetClient, self: typeof window) { base: new URL(client.url.origin), origin: new URL(client.url.origin), } as URLMeta, - true, + true ); } else if (["srcset", "imagesrcset"].includes(attr)) { value = rewriteSrcset(value, client.meta); @@ -183,8 +183,8 @@ export default function (client: ScramjetClient, self: typeof window) { return atob( client.natives["Element.prototype.getAttribute"].call( ctx.this, - "data-scramjet-script-source-src", - ), + "data-scramjet-script-source-src" + ) ); } if (ctx.this instanceof self.HTMLStyleElement) { @@ -277,14 +277,14 @@ export default function (client: ScramjetClient, self: typeof window) { { get(ctx) { const n = ctx.get() as Node; - if (!(n instanceof Document)) return; + if (!(n instanceof Document)) return n; const scram: ScramjetClient = n[SCRAMJETCLIENT]; if (!scram) return n; // ?? return scram.documentProxy; }, - }, + } ); client.Proxy("DOMParser.prototype.parseFromString", { @@ -294,7 +294,7 @@ export default function (client: ScramjetClient, self: typeof window) { ctx.args[0], client.cookieStore, client.meta, - false, + false ); } }, @@ -306,7 +306,7 @@ export default function (client: ScramjetClient, self: typeof window) { ctx.args[0], client.cookieStore, client.meta, - true, + true ); }, }); @@ -317,7 +317,7 @@ export default function (client: ScramjetClient, self: typeof window) { ctx.args[0], client.cookieStore, client.meta, - false, + false ); }, });