misc refactors

This commit is contained in:
velzie 2024-08-31 11:01:51 -04:00
parent 819c1701d0
commit 0939dd2b57
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
25 changed files with 82 additions and 66 deletions

View file

@ -1,5 +1,5 @@
import { ScramjetClient } from "../client";
import { config, rewriteJs } from "../shared";
import { config, rewriteJs } from "../../shared";
export default function (client: ScramjetClient, self: Self) {
// used for proxying *direct eval*

View file

@ -1,5 +1,5 @@
import { ScramjetClient, ProxyCtx, Proxy } from "../client";
import { rewriteJs } from "../shared";
import { rewriteJs } from "../../shared";
function rewriteFunction(ctx: ProxyCtx) {
const stringifiedFunction = ctx.fn(...ctx.args).toString();

View file

@ -1,5 +1,5 @@
import { ScramjetClient } from "../client";
import { config, encodeUrl } from "../shared";
import { config, encodeUrl } from "../../shared";
export default function (client: ScramjetClient, self: Self) {
const Function = client.natives.Function;

View file

@ -1,5 +1,5 @@
import { ScramjetClient } from "../client";
import { config } from "../shared";
import { config } from "../../shared";
export const POLLUTANT = Symbol.for("scramjet realm pollutant");

View file

@ -3,7 +3,7 @@
import { isemulatedsw } from "../..";
import { decodeUrl } from "../../../shared/rewriters/url";
import { ScramjetClient } from "../../client";
import { encodeUrl, rewriteHeaders } from "../../shared";
import { encodeUrl, rewriteHeaders } from "../../../shared";
export default function (client: ScramjetClient, self: typeof globalThis) {
client.Proxy("fetch", {

View file

@ -1,6 +1,6 @@
import { iswindow, isworker } from "../..";
import { ScramjetClient } from "../../client";
import { BareClient } from "../../shared";
import { BareClient } from "../../../shared";
const bare = iswindow && new BareClient();

View file

@ -1,4 +1,4 @@
import { encodeUrl, rewriteHeaders } from "../../shared";
import { encodeUrl, rewriteHeaders } from "../../../shared";
export default function (client, self) {
client.Proxy("XMLHttpRequest.prototype.open", {

View file

@ -1,4 +1,4 @@
import { encodeUrl } from "../shared";
import { encodeUrl } from "../../shared";
import { ScramjetClient } from "../client";
export default function (client: ScramjetClient, self: typeof globalThis) {

View file

@ -1,7 +1,7 @@
import { iswindow, isworker } from "..";
import { SCRAMJETCLIENT } from "../../symbols";
import { ScramjetClient } from "../client";
import { config } from "../shared";
import { config } from "../../shared";
export function createWrapFn(client: ScramjetClient, self: typeof globalThis) {
return function (identifier: any, args: any) {