mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-17 13:30:00 -04:00
Search engines
This commit is contained in:
parent
04cf73e84a
commit
e14f84d1bb
5 changed files with 31 additions and 2 deletions
|
@ -47,6 +47,10 @@
|
||||||
"cloaking": {
|
"cloaking": {
|
||||||
"title": "Cloaking",
|
"title": "Cloaking",
|
||||||
"subtitle": "Choose how your tab looks"
|
"subtitle": "Choose how your tab looks"
|
||||||
|
},
|
||||||
|
"search": {
|
||||||
|
"title": "Search Engine",
|
||||||
|
"subtitle": "Choose your search engine"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"titles": {
|
"titles": {
|
||||||
|
|
|
@ -47,6 +47,10 @@
|
||||||
"cloaking": {
|
"cloaking": {
|
||||||
"title": "Encubrimiento",
|
"title": "Encubrimiento",
|
||||||
"subtitle": "Elige cómo se ve tu pestaña"
|
"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": {
|
"titles": {
|
||||||
|
|
|
@ -47,6 +47,10 @@
|
||||||
"cloaking": {
|
"cloaking": {
|
||||||
"title": "クローキング",
|
"title": "クローキング",
|
||||||
"subtitle": "タブの見た目を選択する"
|
"subtitle": "タブの見た目を選択する"
|
||||||
|
},
|
||||||
|
"search": {
|
||||||
|
"title": "検索エンジン",
|
||||||
|
"subtitle": "ネビュラの検索エンジンを選択してください"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"titles": {
|
"titles": {
|
||||||
|
|
|
@ -20,12 +20,14 @@ export function ProxyFrame(props: { url: string }) {
|
||||||
// pass the URL encoded with encodeURIcomponent
|
// pass the URL encoded with encodeURIcomponent
|
||||||
const localProxy = localStorage.getItem("proxy") || "automatic";
|
const localProxy = localStorage.getItem("proxy") || "automatic";
|
||||||
const proxyMode = localStorage.getItem("proxyMode") || "embed";
|
const proxyMode = localStorage.getItem("proxyMode") || "embed";
|
||||||
|
const searchEngine =
|
||||||
|
localStorage.getItem("searchEngine") || "https://google.com/search?q=%s";
|
||||||
|
|
||||||
const [ProxiedUrl, setProxiedUrl] = useState<string | undefined>(undefined);
|
const [ProxiedUrl, setProxiedUrl] = useState<string | undefined>(undefined);
|
||||||
|
|
||||||
let decodedUrl = decodeURIComponent(props.url);
|
let decodedUrl = decodeURIComponent(props.url);
|
||||||
//attempt to convert to a valid url
|
//attempt to convert to a valid url
|
||||||
decodedUrl = searchUtil(decodedUrl, "https://google.com/search?q=%s");
|
decodedUrl = searchUtil(decodedUrl, searchEngine);
|
||||||
|
|
||||||
let proxyRef;
|
let proxyRef;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,12 @@ const Proxy = ({ id, active }) => {
|
||||||
{ id: "aboutblank", label: t("settings.proxymodes.aboutblank") }
|
{ 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 (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
role="tabpanel"
|
role="tabpanel"
|
||||||
|
@ -30,7 +36,7 @@ const Proxy = ({ id, active }) => {
|
||||||
>
|
>
|
||||||
<motion.div
|
<motion.div
|
||||||
variants={settingsPageVariant}
|
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="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>
|
<div class="p-2 text-3xl">{t("settings.proxy.title")}</div>
|
||||||
|
@ -46,6 +52,15 @@ const Proxy = ({ id, active }) => {
|
||||||
refresh={false}
|
refresh={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</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>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue