mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-12 14:00:01 -04:00
playstore bypass support
This commit is contained in:
parent
1999996b2a
commit
1d10e44ba0
2 changed files with 6 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue