mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
guh
This commit is contained in:
commit
555ae496a5
1 changed files with 5 additions and 10 deletions
|
@ -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];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue