playstore bypass support

This commit is contained in:
Toshit Chawda 2024-08-13 21:08:36 -07:00
parent 1999996b2a
commit 1d10e44ba0
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
2 changed files with 6 additions and 5 deletions

View file

@ -20,7 +20,8 @@ Error.stackTraceLimit = 50;
global.rws = rewriteJs;
export function rewriteJs(js: string | ArrayBuffer, origin?: URL) {
if ("window" in globalThis) origin ??= new URL(decodeUrl(location.href));
if ("window" in globalThis)
origin = origin ?? new URL(decodeUrl(location.href));
const before = performance.now();
if (typeof js === "string") {
@ -48,7 +49,8 @@ export function rewriteJs(js: string | ArrayBuffer, origin?: URL) {
//
// if you can ensure all the preconditions are met this is faster than full rewrites
export function rewriteJsNaiive(js: string | ArrayBuffer, origin?: URL) {
if ("window" in globalThis) origin ??= new URL(decodeUrl(location.href));
if ("window" in globalThis)
origin = origin ?? new URL(decodeUrl(location.href));
if (typeof js !== "string") {
js = new TextDecoder().decode(js);