From 1fb6a4c2797f16d0afe58d377393c81cf77a4303 Mon Sep 17 00:00:00 2001 From: MotorTruck1221 Date: Tue, 20 May 2025 17:21:43 -0600 Subject: [PATCH 1/7] Add about blank cloaking(ish) --- src/utils/settings.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utils/settings.ts b/src/utils/settings.ts index e39b8b3..003e4f1 100644 --- a/src/utils/settings.ts +++ b/src/utils/settings.ts @@ -80,6 +80,16 @@ class Settings { this.#storageManager.setVal("searchEngine", engine || SearchEngines.DuckDuckGo); } + aboutBlank() { + window.location.replace("https://google.com"); + const win = window.open(); + const iframe = win!.document.createElement("iframe") as HTMLIFrameElement; + win!.document.body.setAttribute('style', 'margin: 0; height: 100vh; width: 100%;'); + iframe.setAttribute('style', 'border: none; width: 100%; height: 100%; margin: 0;'); + iframe.src = window.location.href; + win!.document.body.appendChild(iframe); + } + async *#init() { yield this.theme(this.#storageManager.getVal("theme") || "default"); } From 5b98da91ff3f801930477bf173c0109cf1e89370 Mon Sep 17 00:00:00 2001 From: MotorTruck1221 Date: Tue, 20 May 2025 17:39:24 -0600 Subject: [PATCH 2/7] Feat: add about blank cloaking --- src/pages/settings/index.astro | 19 +++++++++++++++++++ src/utils/proxy.ts | 4 ++-- src/utils/settings.ts | 4 ++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/pages/settings/index.astro b/src/pages/settings/index.astro index f0a4080..9714228 100644 --- a/src/pages/settings/index.astro +++ b/src/pages/settings/index.astro @@ -33,6 +33,15 @@ Object.keys(SearchEngines).forEach((k) =>

Search Engine

+
+
+

About Blank

+ +
+
+
+

Wisp Server

@@ -84,6 +93,15 @@ Object.keys(SearchEngines).forEach((k) => }); } + const abCloak = async (opts: Options) => { + const cloakInput = document.getElementById("aboutBlankCloaker") as HTMLInputElement; + const cloakButton = document.getElementById("aboutBlankLaunch") as HTMLButtonElement; + cloakButton.addEventListener("click", async () => { + const url = opts.sw.search(cloakInput.value, opts.storageManager.getVal("searchEngine") || "https://google.com"); + opts.settings.aboutBlank(url); + }); + } + const wispServer = async (opts: Options) => { const wispServerSwitcher = document.getElementById("wispServerSwitcher") as HTMLInputElement; const wispServerInfo = document.getElementById("wispServerInfo") as HTMLElement; @@ -139,6 +157,7 @@ Object.keys(SearchEngines).forEach((k) => await transport({settings, sw, storageManager}); await proxy({settings, sw, storageManager}); await searchEngine({settings, sw, storageManager}); + await abCloak({settings, sw, storageManager}); await wispServer({settings, sw, storageManager}); } catch (err) { //console.log(err); diff --git a/src/utils/proxy.ts b/src/utils/proxy.ts index 166e05c..ab5ae7b 100644 --- a/src/utils/proxy.ts +++ b/src/utils/proxy.ts @@ -37,7 +37,7 @@ class SW { } } - #search(input: string, template: string) { + search(input: string, template: string) { try { return new URL(input).toString(); } catch (_) {} @@ -52,7 +52,7 @@ class SW { encodeURL(string: string): string { const proxy = this.#storageManager.getVal("proxy") as "uv" | "sj"; - const input = this.#search(string, this.#storageManager.getVal("searchEngine")); + const input = this.search(string, this.#storageManager.getVal("searchEngine")); return proxy === "uv" ? `${__uv$config.prefix}${__uv$config.encodeUrl!(input)}` : this.#scramjetController!.encodeUrl(input); diff --git a/src/utils/settings.ts b/src/utils/settings.ts index 003e4f1..7bedef1 100644 --- a/src/utils/settings.ts +++ b/src/utils/settings.ts @@ -80,8 +80,8 @@ class Settings { this.#storageManager.setVal("searchEngine", engine || SearchEngines.DuckDuckGo); } - aboutBlank() { - window.location.replace("https://google.com"); + aboutBlank(location: string) { + window.location.replace(location); const win = window.open(); const iframe = win!.document.createElement("iframe") as HTMLIFrameElement; win!.document.body.setAttribute('style', 'margin: 0; height: 100vh; width: 100%;'); From f0879bd1d7478a1924740c3d978bfc5d80bd04a4 Mon Sep 17 00:00:00 2001 From: MotorTruck1221 Date: Sun, 8 Jun 2025 20:41:58 -0600 Subject: [PATCH 3/7] Apparently Owski wanted an entire seperate page --- src/components/SettingsNav.astro | 3 +++ src/pages/settings/cloaking.astro | 7 +++++++ src/utils/types.ts | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/pages/settings/cloaking.astro diff --git a/src/components/SettingsNav.astro b/src/components/SettingsNav.astro index 8a7577a..7470454 100644 --- a/src/components/SettingsNav.astro +++ b/src/components/SettingsNav.astro @@ -17,4 +17,7 @@ const { active } = Astro.props; Social Links + + Cloaking +
diff --git a/src/pages/settings/cloaking.astro b/src/pages/settings/cloaking.astro new file mode 100644 index 0000000..01ba17c --- /dev/null +++ b/src/pages/settings/cloaking.astro @@ -0,0 +1,7 @@ +--- +import SettingsLayout from "@layouts/SettingsLayout.astro" +--- + +
+
+
diff --git a/src/utils/types.ts b/src/utils/types.ts index 2f5caf1..9a96394 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -1,7 +1,7 @@ import type { Props } from "astro"; interface SettingsProps extends Props { - active: "appearance" | "credits" | "links" | "proxy"; + active: "appearance" | "credits" | "links" | "proxy" | "cloaking"; title: string; } From c6e4aaee03c8b820651581062f7512bedd48b56c Mon Sep 17 00:00:00 2001 From: MotorTruck1221 Date: Sun, 8 Jun 2025 20:43:34 -0600 Subject: [PATCH 4/7] Imma fix CI too --- .github/workflows/releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index c076a12..430e443 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -36,7 +36,7 @@ jobs: cache: "pnpm" - name: Install dependencies - run: pnpm install --no-frozen-lockfile + run: pnpm install --frozen-lockfile - name: Create Release Pull Request or Publish id: changesets From 4d4a30f179066fff4d6f6fa519ebc5285236bb4d Mon Sep 17 00:00:00 2001 From: MotorTruck1221 Date: Sun, 8 Jun 2025 20:56:14 -0600 Subject: [PATCH 5/7] Page added, functionality next --- src/pages/settings/cloaking.astro | 26 +++++++++++++++++++++++++- src/pages/settings/index.astro | 21 +-------------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/pages/settings/cloaking.astro b/src/pages/settings/cloaking.astro index 01ba17c..39441d2 100644 --- a/src/pages/settings/cloaking.astro +++ b/src/pages/settings/cloaking.astro @@ -1,7 +1,31 @@ --- -import SettingsLayout from "@layouts/SettingsLayout.astro" +import SettingsLayout from "@layouts/SettingsLayout.astro"; +import Input from "@components/ui/Input.astro"; +import Button from "@components/ui/Button.astro"; ---
+
+
+
+

About Blank

+ +
+
+
+
+
+
+

Blob

+ +
+
+
+
+
+ diff --git a/src/pages/settings/index.astro b/src/pages/settings/index.astro index 9714228..b487ee6 100644 --- a/src/pages/settings/index.astro +++ b/src/pages/settings/index.astro @@ -33,15 +33,6 @@ Object.keys(SearchEngines).forEach((k) =>

Search Engine

-
-
-

About Blank

- -
-
-
-

Wisp Server

@@ -91,16 +82,7 @@ Object.keys(SearchEngines).forEach((k) => seEl.addEventListener("change", async () => { opts.settings.searchEngine(seEl.value); }); - } - - const abCloak = async (opts: Options) => { - const cloakInput = document.getElementById("aboutBlankCloaker") as HTMLInputElement; - const cloakButton = document.getElementById("aboutBlankLaunch") as HTMLButtonElement; - cloakButton.addEventListener("click", async () => { - const url = opts.sw.search(cloakInput.value, opts.storageManager.getVal("searchEngine") || "https://google.com"); - opts.settings.aboutBlank(url); - }); - } + } const wispServer = async (opts: Options) => { const wispServerSwitcher = document.getElementById("wispServerSwitcher") as HTMLInputElement; @@ -157,7 +139,6 @@ Object.keys(SearchEngines).forEach((k) => await transport({settings, sw, storageManager}); await proxy({settings, sw, storageManager}); await searchEngine({settings, sw, storageManager}); - await abCloak({settings, sw, storageManager}); await wispServer({settings, sw, storageManager}); } catch (err) { //console.log(err); From 3d3693f40fdd852337139fcba2bbe2ae84699617 Mon Sep 17 00:00:00 2001 From: MotorTruck1221 Date: Sun, 8 Jun 2025 21:09:35 -0600 Subject: [PATCH 6/7] Add back about blank, start on blob --- src/components/Loader.astro | 2 +- src/pages/settings/cloaking.astro | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/components/Loader.astro b/src/components/Loader.astro index f2d9651..2141ae6 100644 --- a/src/components/Loader.astro +++ b/src/components/Loader.astro @@ -9,7 +9,7 @@ settings.proxy(); await sw.wispServer(); } - + init(); document.addEventListener('astro:after-swap', async () => { //const settings = await Settings.getInstance(); diff --git a/src/pages/settings/cloaking.astro b/src/pages/settings/cloaking.astro index 39441d2..7b25934 100644 --- a/src/pages/settings/cloaking.astro +++ b/src/pages/settings/cloaking.astro @@ -28,4 +28,23 @@ import Button from "@components/ui/Button.astro";
From b0ddd8eb08b2e50ba275e1f3abdf5ecf68018afe Mon Sep 17 00:00:00 2001 From: MotorTruck1221 Date: Sun, 8 Jun 2025 21:46:53 -0600 Subject: [PATCH 7/7] Add blob cloaking --- src/pages/index.astro | 5 +++- src/pages/settings/cloaking.astro | 17 +++++++++-- src/utils/settings.ts | 48 +++++++++++++++++++++++++------ 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 2394a1c..2acc52e 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -127,6 +127,9 @@ const link = Astro.url.searchParams.get("redir"); customElements.define('link-element', CustomComponent); document.addEventListener("astro:page-load", async () => { - await init(); + try { + await init(); + } + catch (_) {} }); diff --git a/src/pages/settings/cloaking.astro b/src/pages/settings/cloaking.astro index 7b25934..a98f475 100644 --- a/src/pages/settings/cloaking.astro +++ b/src/pages/settings/cloaking.astro @@ -37,7 +37,16 @@ import Button from "@components/ui/Button.astro"; const button = document.getElementById("aboutBlankLaunch") as HTMLButtonElement; button.addEventListener("click", () => { const url = sw.search(input.value, storage.getVal('searchEngine')); - settings.aboutBlank(url); + settings.cloak(url).aboutBlank(); + }); + }; + + const handleBlob = async (settings: Settings, sw: SW, storage: StoreManager<"radius||settings">) => { + const input = document.getElementById("blobCloaker") as HTMLInputElement; + const button = document.getElementById("blobLaunch") as HTMLButtonElement; + button.addEventListener("click", () => { + const url = sw.search(input.value, storage.getVal('searchEngine')); + settings.cloak(url).blob(); }); }; @@ -45,6 +54,10 @@ import Button from "@components/ui/Button.astro"; const settings = await Settings.getInstance(); const sw = SW.getInstance().next().value!; const storageManager = new StoreManager<"radius||settings">("radius||settings"); - await handleAb(settings, sw, storageManager); + try { + await handleAb(settings, sw, storageManager); + await handleBlob(settings, sw, storageManager); + } + catch (_) {} }); diff --git a/src/utils/settings.ts b/src/utils/settings.ts index 7bedef1..a3bddcf 100644 --- a/src/utils/settings.ts +++ b/src/utils/settings.ts @@ -80,14 +80,46 @@ class Settings { this.#storageManager.setVal("searchEngine", engine || SearchEngines.DuckDuckGo); } - aboutBlank(location: string) { - window.location.replace(location); - const win = window.open(); - const iframe = win!.document.createElement("iframe") as HTMLIFrameElement; - win!.document.body.setAttribute('style', 'margin: 0; height: 100vh; width: 100%;'); - iframe.setAttribute('style', 'border: none; width: 100%; height: 100%; margin: 0;'); - iframe.src = window.location.href; - win!.document.body.appendChild(iframe); + cloak(location: string) { + return { + aboutBlank: () => { + const win = window.open(); + if (!win) return; + window.location.replace(location); + const iframe = win.document.createElement("iframe") as HTMLIFrameElement; + win.document.body.setAttribute('style', 'margin: 0; height: 100vh; width: 100%;'); + iframe.setAttribute('style', 'border: none; width: 100%; height: 100%; margin: 0;'); + iframe.src = window.location.href; + win.document.body.appendChild(iframe); + }, + blob: () => { + const win = window.open(); + if (!win) return; + window.location.replace(location); + const content = ` + + + + + + + + + + `; + const blob = new Blob([content], { type: 'text/html' }); + const url = URL.createObjectURL(blob); + win.location.href = url; + } + } } async *#init() {