From 0e817629d33521bb550d31ce25ff01c38527edc5 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Wed, 27 Apr 2022 20:50:59 +0300 Subject: [PATCH] Removed startpage as it has an extension #222 --- pug/options/search/search.pug | 5 ++--- src/assets/javascripts/helpers/search.js | 12 +++--------- src/assets/javascripts/helpers/tiktok.js | 1 - src/pages/options/search/search.html | 5 ++--- src/pages/options/search/search.js | 11 ----------- 5 files changed, 7 insertions(+), 27 deletions(-) diff --git a/pug/options/search/search.pug b/pug/options/search/search.pug index 61664b9..3bdc6d7 100644 --- a/pug/options/search/search.pug +++ b/pug/options/search/search.pug @@ -13,12 +13,11 @@ body.option(dir="auto") input#disable-search(type="checkbox") .some-block.option-block - h4#frontend(data-localise="__MSG_frontend__") Frontend + h4(data-localise="__MSG_frontend__") Frontend select#search-frontend - option(value="searx") SearX option(value="searxng") SearXNG + option(value="searx") SearX option(value="whoogle") Whoogle - option(value="startpage") Startpage #searx-whoogle diff --git a/src/assets/javascripts/helpers/search.js b/src/assets/javascripts/helpers/search.js index ab8c0f2..0fab3a9 100644 --- a/src/assets/javascripts/helpers/search.js +++ b/src/assets/javascripts/helpers/search.js @@ -25,10 +25,7 @@ let redirects = { "normal": [], "tor": [], "i2p": [] - }, - "startpage": { - "normal": "https://www.startpage.com", - }, + } }; const getRedirects = () => redirects; const getCustomRedirects = () => { @@ -430,14 +427,11 @@ function redirect(url) { randomInstance = commonHelper.getRandomInstance(instancesList) path = "/search"; } - else if (frontend == 'startpage') { - randomInstance = redirects.startpage.normal; - path = "/do/search"; - } + if ( ((url.hostname.includes('google') || url.hostname.includes('bing')) && !url.searchParams.has('q')) || (url.hostname.includes('yandex') && !url.searchParams.has('text')) - ) path = '/'; + ) path = '/'; let searchQuery = ""; diff --git a/src/assets/javascripts/helpers/tiktok.js b/src/assets/javascripts/helpers/tiktok.js index bd91849..6c941d2 100644 --- a/src/assets/javascripts/helpers/tiktok.js +++ b/src/assets/javascripts/helpers/tiktok.js @@ -174,7 +174,6 @@ async function initDefaults() { async function init() { return new Promise(resolve => { - console.log('redirects', redirects) browser.storage.local.get( [ "disableTiktok", diff --git a/src/pages/options/search/search.html b/src/pages/options/search/search.html index 01e8511..cc1bb00 100644 --- a/src/pages/options/search/search.html +++ b/src/pages/options/search/search.html @@ -63,12 +63,11 @@
-

Frontend

+

Frontend

diff --git a/src/pages/options/search/search.js b/src/pages/options/search/search.js index 1483430..197b17f 100644 --- a/src/pages/options/search/search.js +++ b/src/pages/options/search/search.js @@ -12,35 +12,24 @@ let whoogleDivElement = document.getElementById("whoogle"); function changeFrontendsSettings(frontend) { let SearxWhoogleElement = document.getElementById("searx-whoogle"); - let frontendElement = document.getElementById("frontend"); if (frontend == 'searx') { - frontendElement.innerHTML = 'Frontend'; searxDivElement.style.display = 'block'; searxngDivElement.style.display = 'none'; whoogleDivElement.style.display = 'none'; SearxWhoogleElement.style.display = 'block'; } else if (frontend == 'searxng') { - frontendElement.innerHTML = 'Frontend'; searxDivElement.style.display = 'none'; searxngDivElement.style.display = 'block'; whoogleDivElement.style.display = 'none'; SearxWhoogleElement.style.display = 'block'; } else if (frontend == 'whoogle') { - frontendElement.innerHTML = 'Frontend'; searxDivElement.style.display = 'none'; searxngDivElement.style.display = 'none'; whoogleDivElement.style.display = 'block'; SearxWhoogleElement.style.display = 'block'; } - else if (frontend == 'startpage') { - frontendElement.innerHTML = `Frontend: This is a centralized service`; - searxDivElement.style.display = 'none'; - searxngDivElement.style.display = 'none'; - whoogleDivElement.style.display = 'none'; - SearxWhoogleElement.style.display = 'none'; - } } let searchFrontendElement = document.getElementById("search-frontend"); searchFrontendElement.addEventListener("change",