url proxy

This commit is contained in:
Avad3 2024-07-14 15:47:36 -04:00
parent ba42d3083e
commit 5afa089984
2 changed files with 10 additions and 0 deletions

View file

@ -12,6 +12,7 @@ import "./storage.ts";
import "./css.ts";
import "./history.ts"
import "./worker.ts";
import "./url.ts";
declare global {
interface Window {

9
src/client/url.ts Normal file
View file

@ -0,0 +1,9 @@
import { encodeUrl } from "../shared/rewriters/url";
URL = new Proxy(URL, {
construct(target, argArray, newTarget) {
if (typeof argArray[0] === "string") argArray[0] = encodeUrl(argArray[0]);
return Reflect.construct(target, argArray, newTarget);
},
})