diff --git a/index.html b/index.html
index 70076fd..b6e2163 100644
--- a/index.html
+++ b/index.html
@@ -4,7 +4,7 @@
-
T3 Search
+ Unduck
diff --git a/src/main.ts b/src/main.ts
index f7d188d..f8d584a 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -2,10 +2,22 @@ import { bangs } from "./bang";
const defaultBang = bangs.find((b) => b.t === "g");
+function noSearchDefaultPageRender() {
+ const app = document.querySelector("#app")!;
+ app.innerHTML = `
+
+
Unduck
+
+ `;
+}
+
function getBangredirectUrl() {
const url = new URL(window.location.href);
const query = url.searchParams.get("q")?.trim() ?? "";
- if (!query) return null;
+ if (!query) {
+ noSearchDefaultPageRender();
+ return null;
+ }
const match = query.match(/!([a-z]+)/i);
@@ -26,6 +38,10 @@ function getBangredirectUrl() {
return searchUrl;
}
-const searchUrl = getBangredirectUrl() ?? "https://www.google.com";
+function doRedirect() {
+ const searchUrl = getBangredirectUrl();
+ if (!searchUrl) return;
+ window.location.replace(searchUrl);
+}
-window.location.replace(searchUrl);
+doRedirect();