From 96a753e8b8749e2c99ceb1c6200c133f0a270804 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 20 Nov 2025 09:30:48 +0000 Subject: [PATCH 1/2] Initial plan From 8c1b10c8a50fbcd69ec7056ec100d90439e34180 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 20 Nov 2025 09:38:51 +0000 Subject: [PATCH 2/2] Add UpperSearchBar component with about: URL support Co-authored-by: sriail <225764385+sriail@users.noreply.github.com> --- src/components/Header.astro | 4 +- src/components/ui/UpperSearchBar.astro | 103 +++++++++++++++++++++++++ src/pages/index.astro | 30 ++++++- 3 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 src/components/ui/UpperSearchBar.astro diff --git a/src/components/Header.astro b/src/components/Header.astro index cdf4582..b908dfb 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,5 +1,6 @@ --- import { Icon } from "astro-icon/components"; +import UpperSearchBar from "@components/ui/UpperSearchBar.astro"; const path = Astro.url.pathname; ---
@@ -7,7 +8,7 @@ const path = Astro.url.pathname; - +

Radius

@@ -32,6 +33,7 @@ const path = Astro.url.pathname; */}
+
diff --git a/src/components/ui/UpperSearchBar.astro b/src/components/ui/UpperSearchBar.astro new file mode 100644 index 0000000..1852b84 --- /dev/null +++ b/src/components/ui/UpperSearchBar.astro @@ -0,0 +1,103 @@ +--- +import { Icon } from "astro-icon/components"; +--- +
+ + +
+ + diff --git a/src/pages/index.astro b/src/pages/index.astro index 737b9d0..0da3155 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -63,11 +63,33 @@ const link = Astro.url.searchParams.get("redir"); const sw = SW.getInstance().next().value!; await sw.ready(); + // Function to handle about: URLs + const handleAboutUrl = (url: string): string | null => { + const lowerUrl = url.toLowerCase().trim(); + if (lowerUrl === "about:settings") { + return "/settings"; + } else if (lowerUrl === "about:home") { + return "/"; + } else if (lowerUrl === "about:404") { + return "/404"; + } + return null; + }; + input.addEventListener("keypress", async (event: any) => { if (event.key === "Enter") { + const inputValue = input.value.trim(); + + // Check for about: URLs first + const aboutUrl = handleAboutUrl(inputValue); + if (aboutUrl) { + window.location.href = aboutUrl; + return; + } + const settings = await Settings.getInstance(); iframe.classList.remove("hidden"); - iframe.src = sw.encodeURL(input.value); + iframe.src = sw.encodeURL(inputValue); buttons(); } }); @@ -111,6 +133,12 @@ const link = Astro.url.searchParams.get("redir"); phlImage.src = object; bhl.classList.add("hidden"); phl.classList.remove("hidden"); + + // Update upper search bar with the current URL + const upperSearchInput = document.getElementById("upperSearchInput") as HTMLInputElement; + if (upperSearchInput) { + upperSearchInput.value = pageURL; + } }); }