Revert "small changes"

This reverts commit 3a85734b7f.
This commit is contained in:
Percs 2024-07-12 16:09:48 -05:00
parent 759ebd747e
commit 35b1d08bfb
21 changed files with 196 additions and 257 deletions

View file

@ -1,11 +1,10 @@
// @ts-nocheck
import { encodeUrl, decodeUrl } from "../bundle";
function urlLocation() {
const loc = new URL(decodeUrl(location.href));
loc.assign = (url: string) => location.assign(encodeUrl(url));
let loc = new URL(self.__scramjet$bundle.rewriters.url.decodeUrl(location.href));
loc.assign = (url: string) => location.assign(self.__scramjet$bundle.rewriters.url.encodeUrl(url));
loc.reload = () => location.reload();
loc.replace = (url: string) => location.replace(encodeUrl(url));
loc.replace = (url: string) => location.replace(self.__scramjet$bundle.rewriters.url.encodeUrl(url));
loc.toString = () => loc.href;
return loc;
@ -21,7 +20,7 @@ export function LocationProxy() {
set(obj, prop, value) {
if (prop === "href") {
location.href = encodeUrl(value);
location.href = self.__scramjet$bundle.rewriters.url.encodeUrl(value);
} else {
loc[prop] = value;
}