Search engines

This commit is contained in:
rift 2023-12-27 17:14:12 -06:00
parent 04cf73e84a
commit e14f84d1bb
5 changed files with 31 additions and 2 deletions

View file

@ -47,6 +47,10 @@
"cloaking": {
"title": "Cloaking",
"subtitle": "Choose how your tab looks"
},
"search": {
"title": "Search Engine",
"subtitle": "Choose your search engine"
}
},
"titles": {

View file

@ -47,6 +47,10 @@
"cloaking": {
"title": "Encubrimiento",
"subtitle": "Elige cómo se ve tu pestaña"
},
"search": {
"title": "Motor de búsqueda",
"subtitle": "Elija su motor de búsqueda para Nebula."
}
},
"titles": {

View file

@ -47,6 +47,10 @@
"cloaking": {
"title": "クローキング",
"subtitle": "タブの見た目を選択する"
},
"search": {
"title": "検索エンジン",
"subtitle": "ネビュラの検索エンジンを選択してください"
}
},
"titles": {

View file

@ -20,12 +20,14 @@ export function ProxyFrame(props: { url: string }) {
// pass the URL encoded with encodeURIcomponent
const localProxy = localStorage.getItem("proxy") || "automatic";
const proxyMode = localStorage.getItem("proxyMode") || "embed";
const searchEngine =
localStorage.getItem("searchEngine") || "https://google.com/search?q=%s";
const [ProxiedUrl, setProxiedUrl] = useState<string | undefined>(undefined);
let decodedUrl = decodeURIComponent(props.url);
//attempt to convert to a valid url
decodedUrl = searchUtil(decodedUrl, "https://google.com/search?q=%s");
decodedUrl = searchUtil(decodedUrl, searchEngine);
let proxyRef;

View file

@ -19,6 +19,12 @@ const Proxy = ({ id, active }) => {
{ id: "aboutblank", label: t("settings.proxymodes.aboutblank") }
];
const searchEngines = [
{ id: "https://google.com/search?q=%s", label: "Google" },
{ id: "https://bing.com/search?q=%s", label: "Bing" },
{ id: "https://duckduckgo.com/?q=%s", label: "DuckDuckGo" }
];
return (
<motion.div
role="tabpanel"
@ -30,7 +36,7 @@ const Proxy = ({ id, active }) => {
>
<motion.div
variants={settingsPageVariant}
className="content-card justify-center flex w-full flex-row flex-wrap gap-4"
className="content-card flex w-full flex-row flex-wrap justify-center gap-4"
>
<div class="flex h-64 w-80 flex-col flex-wrap content-center items-center rounded-lg border border-input-border-color bg-lighter p-7 text-center">
<div class="p-2 text-3xl">{t("settings.proxy.title")}</div>
@ -46,6 +52,15 @@ const Proxy = ({ id, active }) => {
refresh={false}
/>
</div>
<div class="flex h-64 w-80 flex-col flex-wrap content-center items-center rounded-lg border border-input-border-color bg-lighter p-7 text-center">
<div class="p-2 text-3xl">{t("settings.search.title")}</div>
<div class="text-md p-4">{t("settings.search.subtitle")}</div>
<Dropdown
storageKey="searchEngine"
options={searchEngines}
refresh={false}
/>
</div>
</motion.div>
</motion.div>
);