Skip to content

Commit ab10602

Browse files
committed
[scramjet] remove config.files
1 parent e283ed1 commit ab10602

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

packages/scramjet/src/client/dom/performance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export default function (client: ScramjetClient, _self: Self) {
1818

1919
const filterEntries = (entries: PerformanceEntry[]) => {
2020
return entries.filter((entry) => {
21-
for (const file of Object.values(config.files)) {
22-
if (entry.name.startsWith(location.origin + file)) {
21+
for (const file of config.maskedfiles) {
22+
if (entry.name.endsWith(file)) {
2323
return false;
2424
}
2525
}

packages/scramjet/src/client/shared/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function (client: ScramjetClient, _self: Self) {
1414
const url = stack[i].getFileName();
1515

1616
try {
17-
if (url.endsWith(config.files.all)) {
17+
if (config.maskedfiles.some((f) => url.endsWith(f))) {
1818
// strip stack frames including scramjet handlers from the trace
1919
const lines = newstack.split("\n");
2020
const line = lines.find((l) => l.includes(url));

packages/scramjet/src/client/shared/requests/xmlhttprequest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { ScramjetClient } from "@client/index";
44

55
export default function (client: ScramjetClient, self: Self) {
66
let worker;
7-
if (self.Worker && flagEnabled("syncxhr", client.url)) {
8-
worker = client.natives.construct("Worker", config.files.sync);
9-
}
7+
// if (self.Worker && flagEnabled("syncxhr", client.url)) {
8+
// worker = client.natives.construct("Worker", config.files.sync);
9+
// }
1010
const ARGS = Symbol("xhr original args");
1111
const HEADERS = Symbol("xhr headers");
1212

packages/scramjet/src/types.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { ScramjetClient } from "@client/index";
2-
import { ScramjetFrame } from "@/controller/frame";
32
import { SCRAMJETCLIENT, SCRAMJETFRAME } from "@/symbols";
4-
import * as controller from "@/controller/index";
53
import * as client from "@/client/entry";
6-
import * as worker from "@/worker/index";
74
import { DBSchema } from "idb";
85

96
/**
@@ -51,11 +48,7 @@ export interface ScramjetConfig {
5148
templocid: string;
5249
tempunusedid: string;
5350
};
54-
files: {
55-
wasm: string;
56-
all: string;
57-
sync: string;
58-
};
51+
maskedfiles: string[];
5952
flags: ScramjetFlags;
6053
siteFlags: Record<string, Partial<ScramjetFlags>>;
6154
codec: {
@@ -97,7 +90,7 @@ declare global {
9790
/**
9891
* The event target belonging to an iframe element holding an encoded URL.
9992
*/
100-
[SCRAMJETFRAME]: ScramjetFrame;
93+
// [SCRAMJETFRAME]: ScramjetFrame;
10194
}
10295
}
10396

0 commit comments

Comments
 (0)