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 diff --git a/astro.config.ts b/astro.config.ts index 07ab795..b474e0c 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -18,7 +18,7 @@ const viteWispServer = (): Plugin => { name: "vite-wisp-server", configureServer(server) { server.httpServer?.on("upgrade", (req, socket, head) => { - req.url.startsWith("/wisp") ? wisp.routeRequest(req, socket, head) : undefined; + req.url.startsWith("/wisp") || req.url.startsWith("/adblock") ? wisp.routeRequest(req, socket, head) : undefined; }); } }; diff --git a/server/index.ts b/server/index.ts index ca58c6d..4dab568 100644 --- a/server/index.ts +++ b/server/index.ts @@ -23,7 +23,8 @@ const serverFactory: FastifyServerFactory = ( handler(req, res); }) .on("upgrade", (req, socket, head) => { - if (req.url?.endsWith("/wisp/")) { + if (req.url?.endsWith("/wisp/") || req.url?.endsWith("/adblock/")) { + console.log(req.url); wisp.routeRequest(req, socket as Socket, head); } }); diff --git a/src/components/Loader.astro b/src/components/Loader.astro index f2d9651..5c2ccb5 100644 --- a/src/components/Loader.astro +++ b/src/components/Loader.astro @@ -7,9 +7,10 @@ const init = async () => { settings.searchEngine(); settings.proxy(); + settings.adBlock(); await sw.wispServer(); } - + init(); document.addEventListener('astro:after-swap', async () => { //const settings = await Settings.getInstance(); 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/components/ui/Dropdown.astro b/src/components/ui/Dropdown.astro index b0a59e7..751d95e 100644 --- a/src/components/ui/Dropdown.astro +++ b/src/components/ui/Dropdown.astro @@ -2,12 +2,13 @@ import type { DropdownOptions } from "@utils/types"; interface Props { id: string; + classes?: string; options: DropdownOptions[]; } -const { id, options } = Astro.props; +const { id, options, classes } = Astro.props; --- - {options.map((el) => )} diff --git a/src/pages/index.astro b/src/pages/index.astro index 5351b9d..2acc52e 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -62,7 +62,6 @@ const link = Astro.url.searchParams.get("redir"); if (event.key === "Enter") { const sw = SW.getInstance().next().value!; const settings = await Settings.getInstance(); - await sw.setTransport(); iframe.classList.remove("hidden"); iframe.src = sw.encodeURL(input.value); } @@ -123,9 +122,14 @@ const link = Astro.url.searchParams.get("redir"); history.pushState({}, "", "/"); })(); } - (async () => { await init(); })(); } } - + customElements.define('link-element', CustomComponent); + document.addEventListener("astro:page-load", async () => { + try { + await init(); + } + catch (_) {} + }); diff --git a/src/pages/settings/cloaking.astro b/src/pages/settings/cloaking.astro new file mode 100644 index 0000000..a98f475 --- /dev/null +++ b/src/pages/settings/cloaking.astro @@ -0,0 +1,63 @@ +--- +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 f0a4080..d539f1a 100644 --- a/src/pages/settings/index.astro +++ b/src/pages/settings/index.astro @@ -37,6 +37,15 @@ Object.keys(SearchEngines).forEach((k) =>

Wisp Server

+