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;
+ }
});
}