mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
percs i swear to god
This commit is contained in:
parent
30c95934ed
commit
b180272b17
4 changed files with 12 additions and 13 deletions
|
@ -28,7 +28,6 @@
|
|||
"@mercuryworkshop/bare-as-module3": "^2.2.2",
|
||||
"@mercuryworkshop/epoxy-transport": "^2.1.5",
|
||||
"@mercuryworkshop/libcurl-transport": "^1.3.7",
|
||||
"wisp-server-node": "^1.1.3",
|
||||
"@rsdoctor/rspack-plugin": "^0.3.7",
|
||||
"@rspack/cli": "^0.7.5",
|
||||
"@rspack/core": "^0.7.5",
|
||||
|
@ -44,18 +43,19 @@
|
|||
"fastify": "^4.26.2",
|
||||
"prettier": "^3.3.3",
|
||||
"tslib": "^2.6.2",
|
||||
"typescript": "^5.4.5"
|
||||
"typescript": "^5.4.5",
|
||||
"wisp-server-node": "^1.1.3"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@mercuryworkshop/bare-mux": "^2.0.2",
|
||||
"@webreflection/idb-map": "^0.3.1",
|
||||
"astravel": "^0.6.1",
|
||||
"astring": "^1.8.6",
|
||||
"dom-serializer": "^2.0.0",
|
||||
"domhandler": "^5.0.3",
|
||||
"domutils": "^3.1.0",
|
||||
"htmlparser2": "^9.1.0",
|
||||
"idb-map-entries": "^0.3.2",
|
||||
"meriyah": "^4.4.2",
|
||||
"parse-domain": "^8.0.2",
|
||||
"set-cookie-parser": "^2.6.0"
|
||||
|
|
|
@ -102,7 +102,6 @@ function traverseParsedHtml(node, origin?: URL) {
|
|||
const htmlcomment = /<!--[\s\S]*?-->/g;
|
||||
js = js.replace(htmlcomment, "");
|
||||
node.children[0].data = rewriteJs(js, origin);
|
||||
console.log(node.children);
|
||||
}
|
||||
if (node.name === "meta" && hasAttrib(node, "http-equiv")) {
|
||||
if (node.attribs["http-equiv"] === "content-security-policy") {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { BareResponseFetch } from "@mercuryworkshop/bare-mux";
|
||||
import IDBMap from "idb-map-entries";
|
||||
import IDBMap from "@webreflection/idb-map";
|
||||
import { ParseResultType } from "parse-domain";
|
||||
import { ScramjetServiceWorker } from ".";
|
||||
import { renderError } from "./error";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import IDBMap from "idb-map-entries";
|
||||
import IDBMap from "@webreflection/idb-map";
|
||||
import { FakeServiceWorker } from "./fakesw";
|
||||
import { swfetch } from "./fetch";
|
||||
import { ScramjetThreadpool } from "./threadpool";
|
||||
|
@ -20,7 +20,6 @@ export class ScramjetServiceWorker {
|
|||
serviceWorkers: FakeServiceWorker[] = [];
|
||||
|
||||
constructor() {
|
||||
this.loadConfig();
|
||||
this.client = new self.$scramjet.shared.util.BareClient();
|
||||
|
||||
this.threadpool = new ScramjetThreadpool();
|
||||
|
@ -46,17 +45,18 @@ export class ScramjetServiceWorker {
|
|||
});
|
||||
}
|
||||
|
||||
loadConfig() {
|
||||
async loadConfig() {
|
||||
if (this.config) return;
|
||||
|
||||
const store = new IDBMap("config", {
|
||||
prefix: "scramjet",
|
||||
});
|
||||
|
||||
if (store.has("config")) {
|
||||
store.get("config").then((config) => {
|
||||
const config = await store.get("config");
|
||||
this.config = config;
|
||||
self.$scramjet.config = config;
|
||||
self.$scramjet.codec = self.$scramjet.codecs[config.codec];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue