mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
url proxy
This commit is contained in:
parent
ba42d3083e
commit
5afa089984
2 changed files with 10 additions and 0 deletions
|
@ -12,6 +12,7 @@ import "./storage.ts";
|
||||||
import "./css.ts";
|
import "./css.ts";
|
||||||
import "./history.ts"
|
import "./history.ts"
|
||||||
import "./worker.ts";
|
import "./worker.ts";
|
||||||
|
import "./url.ts";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
|
|
9
src/client/url.ts
Normal file
9
src/client/url.ts
Normal 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);
|
||||||
|
},
|
||||||
|
})
|
Loading…
Add table
Add a link
Reference in a new issue