Removed startpage as it has an extension #222
This commit is contained in:
parent
cf1b632529
commit
0e817629d3
|
@ -13,12 +13,11 @@ body.option(dir="auto")
|
||||||
input#disable-search(type="checkbox")
|
input#disable-search(type="checkbox")
|
||||||
|
|
||||||
.some-block.option-block
|
.some-block.option-block
|
||||||
h4#frontend(data-localise="__MSG_frontend__") Frontend
|
h4(data-localise="__MSG_frontend__") Frontend
|
||||||
select#search-frontend
|
select#search-frontend
|
||||||
option(value="searx") SearX
|
|
||||||
option(value="searxng") SearXNG
|
option(value="searxng") SearXNG
|
||||||
|
option(value="searx") SearX
|
||||||
option(value="whoogle") Whoogle
|
option(value="whoogle") Whoogle
|
||||||
option(value="startpage") Startpage
|
|
||||||
|
|
||||||
|
|
||||||
#searx-whoogle
|
#searx-whoogle
|
||||||
|
|
|
@ -25,10 +25,7 @@ let redirects = {
|
||||||
"normal": [],
|
"normal": [],
|
||||||
"tor": [],
|
"tor": [],
|
||||||
"i2p": []
|
"i2p": []
|
||||||
},
|
}
|
||||||
"startpage": {
|
|
||||||
"normal": "https://www.startpage.com",
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
const getRedirects = () => redirects;
|
const getRedirects = () => redirects;
|
||||||
const getCustomRedirects = () => {
|
const getCustomRedirects = () => {
|
||||||
|
@ -430,14 +427,11 @@ function redirect(url) {
|
||||||
randomInstance = commonHelper.getRandomInstance(instancesList)
|
randomInstance = commonHelper.getRandomInstance(instancesList)
|
||||||
path = "/search";
|
path = "/search";
|
||||||
}
|
}
|
||||||
else if (frontend == 'startpage') {
|
|
||||||
randomInstance = redirects.startpage.normal;
|
|
||||||
path = "/do/search";
|
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
((url.hostname.includes('google') || url.hostname.includes('bing')) && !url.searchParams.has('q')) ||
|
((url.hostname.includes('google') || url.hostname.includes('bing')) && !url.searchParams.has('q')) ||
|
||||||
(url.hostname.includes('yandex') && !url.searchParams.has('text'))
|
(url.hostname.includes('yandex') && !url.searchParams.has('text'))
|
||||||
) path = '/';
|
) path = '/';
|
||||||
|
|
||||||
let searchQuery = "";
|
let searchQuery = "";
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,6 @@ async function initDefaults() {
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
console.log('redirects', redirects)
|
|
||||||
browser.storage.local.get(
|
browser.storage.local.get(
|
||||||
[
|
[
|
||||||
"disableTiktok",
|
"disableTiktok",
|
||||||
|
|
|
@ -63,12 +63,11 @@
|
||||||
<input id="disable-search" type="checkbox">
|
<input id="disable-search" type="checkbox">
|
||||||
</div>
|
</div>
|
||||||
<div class="some-block option-block">
|
<div class="some-block option-block">
|
||||||
<h4 id="frontend" data-localise="__MSG_frontend__">Frontend</h4>
|
<h4 data-localise="__MSG_frontend__">Frontend</h4>
|
||||||
<select id="search-frontend">
|
<select id="search-frontend">
|
||||||
<option value="searx">SearX</option>
|
|
||||||
<option value="searxng">SearXNG</option>
|
<option value="searxng">SearXNG</option>
|
||||||
|
<option value="searx">SearX</option>
|
||||||
<option value="whoogle">Whoogle</option>
|
<option value="whoogle">Whoogle</option>
|
||||||
<option value="startpage">Startpage</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div id="searx-whoogle">
|
<div id="searx-whoogle">
|
||||||
|
|
|
@ -12,35 +12,24 @@ let whoogleDivElement = document.getElementById("whoogle");
|
||||||
|
|
||||||
function changeFrontendsSettings(frontend) {
|
function changeFrontendsSettings(frontend) {
|
||||||
let SearxWhoogleElement = document.getElementById("searx-whoogle");
|
let SearxWhoogleElement = document.getElementById("searx-whoogle");
|
||||||
let frontendElement = document.getElementById("frontend");
|
|
||||||
if (frontend == 'searx') {
|
if (frontend == 'searx') {
|
||||||
frontendElement.innerHTML = 'Frontend';
|
|
||||||
searxDivElement.style.display = 'block';
|
searxDivElement.style.display = 'block';
|
||||||
searxngDivElement.style.display = 'none';
|
searxngDivElement.style.display = 'none';
|
||||||
whoogleDivElement.style.display = 'none';
|
whoogleDivElement.style.display = 'none';
|
||||||
SearxWhoogleElement.style.display = 'block';
|
SearxWhoogleElement.style.display = 'block';
|
||||||
}
|
}
|
||||||
else if (frontend == 'searxng') {
|
else if (frontend == 'searxng') {
|
||||||
frontendElement.innerHTML = 'Frontend';
|
|
||||||
searxDivElement.style.display = 'none';
|
searxDivElement.style.display = 'none';
|
||||||
searxngDivElement.style.display = 'block';
|
searxngDivElement.style.display = 'block';
|
||||||
whoogleDivElement.style.display = 'none';
|
whoogleDivElement.style.display = 'none';
|
||||||
SearxWhoogleElement.style.display = 'block';
|
SearxWhoogleElement.style.display = 'block';
|
||||||
}
|
}
|
||||||
else if (frontend == 'whoogle') {
|
else if (frontend == 'whoogle') {
|
||||||
frontendElement.innerHTML = 'Frontend';
|
|
||||||
searxDivElement.style.display = 'none';
|
searxDivElement.style.display = 'none';
|
||||||
searxngDivElement.style.display = 'none';
|
searxngDivElement.style.display = 'none';
|
||||||
whoogleDivElement.style.display = 'block';
|
whoogleDivElement.style.display = 'block';
|
||||||
SearxWhoogleElement.style.display = 'block';
|
SearxWhoogleElement.style.display = 'block';
|
||||||
}
|
}
|
||||||
else if (frontend == 'startpage') {
|
|
||||||
frontendElement.innerHTML = `Frontend: <span style="color:red;">This is a centralized service</span>`;
|
|
||||||
searxDivElement.style.display = 'none';
|
|
||||||
searxngDivElement.style.display = 'none';
|
|
||||||
whoogleDivElement.style.display = 'none';
|
|
||||||
SearxWhoogleElement.style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
let searchFrontendElement = document.getElementById("search-frontend");
|
let searchFrontendElement = document.getElementById("search-frontend");
|
||||||
searchFrontendElement.addEventListener("change",
|
searchFrontendElement.addEventListener("change",
|
||||||
|
|
Loading…
Reference in New Issue