aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/main.ts2
-rw-r--r--frontend/query.ts2
-rw-r--r--frontend/ui.ts4
3 files changed, 5 insertions, 3 deletions
diff --git a/frontend/main.ts b/frontend/main.ts
index 85de64e..e14ccac 100644
--- a/frontend/main.ts
+++ b/frontend/main.ts
@@ -20,7 +20,7 @@ function process_url() {
bangs.then(bangs => {
console.log("bop");
- if (!bangs[engine]) {
+ if (!bangs[engine.toLowerCase()]) {
status("error", "Engine does not exist")
window.location.hash = "#"
}
diff --git a/frontend/query.ts b/frontend/query.ts
index a608c57..7fa83e3 100644
--- a/frontend/query.ts
+++ b/frontend/query.ts
@@ -39,5 +39,5 @@ export async function process_query(default_engine: string, query: string) {
}
async function search_url(engine: string, query: string) {
- return (await bangs)[engine]?.url.replace("{{{s}}}", encodeURIComponent(query).replaceAll("%20", "+"))
+ return (await bangs)[engine.toLowerCase()]?.url.replace("{{{s}}}", encodeURIComponent(query).replaceAll("%20", "+"))
}
diff --git a/frontend/ui.ts b/frontend/ui.ts
index 22f9d71..8ce34a4 100644
--- a/frontend/ui.ts
+++ b/frontend/ui.ts
@@ -11,6 +11,7 @@ export function add_page_content(engine?: string) {
}
function section_search(engine: string) {
+ engine = engine.toLowerCase();
const section = document.createElement("section")
section.classList.add("search")
@@ -55,7 +56,8 @@ function section_engine_select() {
section.classList.add("engine-select")
const select = async (e: string) => {
- if (!(await bangs)[e]) return status("error", `Engine ${JSON.stringify(e)} does not exist.`)
+ const engine = e.toLowerCase();
+ if (!(await bangs)[engine]) return status("error", `Engine ${JSON.stringify(e)} does not exist.`)
window.location.hash = `#${e}`
}