fix location.href

This commit is contained in:
velzie 2024-08-31 14:57:40 -04:00
parent 5790cfc1fb
commit 70e0a684ae
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F

View file

@ -43,6 +43,12 @@ export function createLocationProxy(
if (native.set) { if (native.set) {
desc.set = new Proxy(native.set, { desc.set = new Proxy(native.set, {
apply(target, thisArg, args) { apply(target, thisArg, args) {
if (prop === "href") {
// special case
client.url = args[0];
return;
}
let url = new URL(client.url.href); let url = new URL(client.url.href);
url[prop] = args[0]; url[prop] = args[0];
client.url = url; client.url = url;