diff --git a/chrome.html b/chrome.html index 121d4c6..a8e05ca 100644 --- a/chrome.html +++ b/chrome.html @@ -158,11 +158,11 @@ function fillEngines(d) { engineCurrent = d.current; const sel = $("engine"); - sel.innerHTML = d.engines.map((e) => ``; sel.value = d.current; const cur = d.engines.find((e) => e.id === d.current); - $("search").placeholder = cur ? "Search with " + cur.name : "Search"; + $("search").placeholder = cur ? "Search with " + (cur.sym ? cur.sym + " " : "") + cur.name : "Search"; } $("engine").onchange = () => { const v = $("engine").value; diff --git a/main.js b/main.js index 3cf8510..46c34b7 100644 --- a/main.js +++ b/main.js @@ -24,17 +24,17 @@ const RESOLVER = app.isPackaged // Built-in search engines. Users can also add their own (settings.customEngines, // each { id, name, url } where the url contains "%s" for the query). const SEARCH_ENGINES = { - duckduckgo: { name: "DuckDuckGo", url: (q) => "https://duckduckgo.com/?q=" + encodeURIComponent(q) }, - google: { name: "Google", url: (q) => "https://www.google.com/search?q=" + encodeURIComponent(q) }, - brave: { name: "Brave", url: (q) => "https://search.brave.com/search?q=" + encodeURIComponent(q) }, - bing: { name: "Bing", url: (q) => "https://www.bing.com/search?q=" + encodeURIComponent(q) }, - startpage: { name: "Startpage", url: (q) => "https://www.startpage.com/sp/search?query=" + encodeURIComponent(q) }, - yandex: { name: "Yandex", url: (q) => "https://yandex.com/search/?text=" + encodeURIComponent(q) }, + duckduckgo: { name: "DuckDuckGo", sym: "🦆", url: (q) => "https://duckduckgo.com/?q=" + encodeURIComponent(q) }, + google: { name: "Google", sym: "🔵", url: (q) => "https://www.google.com/search?q=" + encodeURIComponent(q) }, + brave: { name: "Brave", sym: "🦁", url: (q) => "https://search.brave.com/search?q=" + encodeURIComponent(q) }, + bing: { name: "Bing", sym: "🔎", url: (q) => "https://www.bing.com/search?q=" + encodeURIComponent(q) }, + startpage: { name: "Startpage", sym: "🛡️", url: (q) => "https://www.startpage.com/sp/search?query=" + encodeURIComponent(q) }, + yandex: { name: "Yandex", sym: "🔴", url: (q) => "https://yandex.com/search/?text=" + encodeURIComponent(q) }, }; -// Built-in + user-added, as flat metadata for the pickers. +// Built-in + user-added, as flat metadata for the pickers (sym = a display symbol). function allEngines() { - const list = Object.entries(SEARCH_ENGINES).map(([id, e]) => ({ id, name: e.name, builtin: true })); - for (const c of settings.customEngines || []) list.push({ id: c.id, name: c.name, builtin: false }); + const list = Object.entries(SEARCH_ENGINES).map(([id, e]) => ({ id, name: e.name, sym: e.sym, builtin: true })); + for (const c of settings.customEngines || []) list.push({ id: c.id, name: c.name, sym: c.sym || "🔍", builtin: false }); return list; } function engineUrl(id, q) { @@ -49,11 +49,15 @@ const GATEWAY = "https://navigate.st"; // ---- BNS name detection (multi-TLD) -------------------------------------- // The engine (resolver-web.js) resolves any