From 52e419f44e28f7e5e46f4b4d3142a264d7ca1bb1 Mon Sep 17 00:00:00 2001 From: Percs <83934299+Percslol@users.noreply.github.com> Date: Sun, 13 Oct 2024 16:21:57 -0500 Subject: [PATCH] chore: code cleanup --- README.md | 2 +- src/controller/index.ts | 1 - src/types.d.ts | 5 ++++- src/worker/error.ts | 6 ++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fa8f916..c16a8a0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ npm version -Scramjet is an experimental inteception based web proxy that aims to be the successor to Ultraviolet. It is designed with security, developer friendlyness, and performance in mind. Scramjet strives to have a clean, organized codebase to improve maintainability. Scramjet is made to evade internet censorship and arbitrary bypass web browser restrictions. +Scramjet is an experimental inteception based web proxy that aims to be the successor to Ultraviolet. It is designed with security, developer friendlyness, and performance in mind. Scramjet strives to have a clean, organized codebase to improve maintainability. Scramjet is made to evade internet censorship and bypass arbitrary web browser restrictions. ## Supported Sites diff --git a/src/controller/index.ts b/src/controller/index.ts index 9cdc4e3..54b46cc 100644 --- a/src/controller/index.ts +++ b/src/controller/index.ts @@ -1,5 +1,4 @@ import { ScramjetConfig } from "../types"; -import { Codec } from "../codecs"; import { ScramjetFrame } from "./frame"; import { $scramjet, loadCodecs } from "../scramjet"; diff --git a/src/types.d.ts b/src/types.d.ts index 6797819..3c3aab0 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -15,7 +15,6 @@ import { import { rewriteJs } from "./shared/rewriters/js"; import { rewriteHeaders } from "./shared/rewriters/headers"; import { rewriteWorkers } from "./shared/rewriters/worker"; -import type { Codec } from "./codecs"; import { BareClient, BareMuxConnection } from "@mercuryworkshop/bare-mux"; import { parseDomain } from "parse-domain"; import { ScramjetHeaders } from "./shared/headers"; @@ -94,6 +93,10 @@ declare global { encode: (url: string) => string; decode: (url: string) => string; }; + version: { + version: string; + build: string; + }; }; COOKIE: string; WASM: string; diff --git a/src/worker/error.ts b/src/worker/error.ts index 48c5c04..525b34a 100644 --- a/src/worker/error.ts +++ b/src/worker/error.ts @@ -1,3 +1,5 @@ +import { $scramjet } from "../scramjet"; + export function errorTemplate(trace: string, fetchedURL: string) { // turn script into a data URI so we don"t have to escape any HTML values const script = ` @@ -5,8 +7,8 @@ export function errorTemplate(trace: string, fetchedURL: string) { fetchedURL.textContent = ${JSON.stringify(fetchedURL)}; for (const node of document.querySelectorAll("#hostname")) node.textContent = ${JSON.stringify(location.hostname)}; reload.addEventListener("click", () => location.reload()); - version.textContent = ${JSON.stringify(VERSION)}; - build.textContent = ${JSON.stringify(COMMITHASH)}; + version.textContent = ${JSON.stringify($scramjet.version.version)}; + build.textContent = ${JSON.stringify($scramjet.version.build)}; `; return `