Skip to content

Commit

Permalink
fix: misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Percslol committed Oct 26, 2024
1 parent 4b32401 commit 5f03f8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/client/dom/origin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function (client: ScramjetClient, self: typeof window) {
},
});

client.Trap("document.URL", {
client.Trap("Document.prototype.URL", {
get() {
return client.url.href;
},
Expand All @@ -21,7 +21,7 @@ export default function (client: ScramjetClient, self: typeof window) {
},
});

client.Trap("document.documentURI", {
client.Trap("Document.prototype.documentURI", {
get() {
return client.url.href;
},
Expand All @@ -30,7 +30,7 @@ export default function (client: ScramjetClient, self: typeof window) {
},
});

client.Trap("document.domain", {
client.Trap("Document.prototype.domain", {
get() {
return client.url.hostname;
},
Expand Down
10 changes: 6 additions & 4 deletions src/worker/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ export async function swfetch(
if (response.body) {
body = await rewriteBody(
response,
{
base: new URL(new URL(client.url).origin),
origin: new URL(new URL(client.url).origin),
},
client
? {
base: new URL(new URL(client.url).origin),
origin: new URL(new URL(client.url).origin),
}
: newmeta(new URL(unrewriteUrl(request.referrer))),
request.destination,
workertype,
this.cookieStore
Expand Down

0 comments on commit 5f03f8d

Please sign in to comment.