This commit is contained in:
velzie 2024-07-13 22:25:44 -04:00
commit 555ae496a5
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F

View file

@ -1,17 +1,12 @@
// @ts-nocheck // @ts-nocheck
import { encodeUrl, decodeUrl } from "../shared"; import { encodeUrl, decodeUrl } from "../shared";
function urlLocation() { const loc = new URL(decodeUrl(location.href));
const loc = new URL(decodeUrl(location.href)); loc.assign = (url: string) => location.assign(encodeUrl(url));
loc.assign = (url: string) => location.assign(encodeUrl(url)); loc.reload = () => location.reload();
loc.reload = () => location.reload(); loc.replace = (url: string) => location.replace(encodeUrl(url));
loc.replace = (url: string) => location.replace(encodeUrl(url)); loc.toString = () => loc.href;
loc.toString = () => loc.href;
return loc;
}
const loc = urlLocation();
export const locationProxy = new Proxy(window.location, { export const locationProxy = new Proxy(window.location, {
get(target, prop) { get(target, prop) {
return loc[prop]; return loc[prop];