mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 23:10:02 -04:00
support url base
This commit is contained in:
parent
a1ce4e33b3
commit
7a9c990b01
32 changed files with 213 additions and 158 deletions
|
@ -1,7 +1,7 @@
|
|||
// @ts-nocheck
|
||||
import { ScramjetClient } from "./client";
|
||||
import { nativeGetOwnPropertyDescriptor } from "./natives";
|
||||
import { encodeUrl, decodeUrl } from "../shared";
|
||||
import { decodeUrl, encodeUrl } from "../shared";
|
||||
import { iswindow } from ".";
|
||||
|
||||
export function createLocationProxy(
|
||||
|
@ -76,7 +76,7 @@ export function createLocationProxy(
|
|||
if (self.location.assign)
|
||||
fakeLocation.assign = new Proxy(self.location.assign, {
|
||||
apply(target, thisArg, args) {
|
||||
args[0] = encodeUrl(args[0]);
|
||||
args[0] = encodeUrl(args[0], client.meta);
|
||||
Reflect.apply(target, self.location, args);
|
||||
},
|
||||
});
|
||||
|
@ -89,7 +89,7 @@ export function createLocationProxy(
|
|||
if (self.location.replace)
|
||||
fakeLocation.replace = new Proxy(self.location.replace, {
|
||||
apply(target, thisArg, args) {
|
||||
args[0] = encodeUrl(args[0]);
|
||||
args[0] = encodeUrl(args[0], client.meta);
|
||||
Reflect.apply(target, self.location, args);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue