mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 23:10:02 -04:00
parent
759ebd747e
commit
35b1d08bfb
21 changed files with 196 additions and 257 deletions
|
@ -1,11 +1,10 @@
|
|||
// @ts-nocheck
|
||||
import { encodeUrl, decodeUrl } from "../bundle";
|
||||
|
||||
function urlLocation() {
|
||||
const loc = new URL(decodeUrl(location.href));
|
||||
loc.assign = (url: string) => location.assign(encodeUrl(url));
|
||||
let loc = new URL(self.__scramjet$bundle.rewriters.url.decodeUrl(location.href));
|
||||
loc.assign = (url: string) => location.assign(self.__scramjet$bundle.rewriters.url.encodeUrl(url));
|
||||
loc.reload = () => location.reload();
|
||||
loc.replace = (url: string) => location.replace(encodeUrl(url));
|
||||
loc.replace = (url: string) => location.replace(self.__scramjet$bundle.rewriters.url.encodeUrl(url));
|
||||
loc.toString = () => loc.href;
|
||||
|
||||
return loc;
|
||||
|
@ -21,7 +20,7 @@ export function LocationProxy() {
|
|||
|
||||
set(obj, prop, value) {
|
||||
if (prop === "href") {
|
||||
location.href = encodeUrl(value);
|
||||
location.href = self.__scramjet$bundle.rewriters.url.encodeUrl(value);
|
||||
} else {
|
||||
loc[prop] = value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue