fix: fix history proxy

This commit is contained in:
Percs 2024-10-23 10:54:46 -05:00
parent 2261d12064
commit 5f70c1c0ac

View file

@ -3,7 +3,7 @@ import { rewriteUrl } from "../../shared";
import { UrlChangeEvent } from "../events";
export default function (client: ScramjetClient, self: typeof globalThis) {
client.Proxy("history.pushState", {
client.Proxy("History.prototype.pushState", {
apply(ctx) {
if (ctx.args[2]) ctx.args[2] = rewriteUrl(ctx.args[2], client.meta);
ctx.call();
@ -13,7 +13,7 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
},
});
client.Proxy("history.replaceState", {
client.Proxy("History.prototype.replaceState", {
apply(ctx) {
if (ctx.args[2]) ctx.args[2] = rewriteUrl(ctx.args[2], client.meta);
ctx.call();