diff options
Diffstat (limited to 'src/assets')
-rw-r--r-- | src/assets/javascripts/helpers/search.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/assets/javascripts/helpers/search.js b/src/assets/javascripts/helpers/search.js index 66d8300a..b90c201c 100644 --- a/src/assets/javascripts/helpers/search.js +++ b/src/assets/javascripts/helpers/search.js @@ -17,6 +17,10 @@ let redirects = { "normal": [], "tor": [] }, + "startpage": { + "normal": "https://www.startpage.com", + "tor": null + } }; const getRedirects = () => redirects; const getCustomRedirects = () => { @@ -154,13 +158,10 @@ function setProtocol(val) { console.log("searchProtocol: ", val) } -function isSearch(url) { - if (disable) return false; - return targets.some((rx) => rx.test(url.href)); -} - function redirect(url) { - console.log(url.href); + if (disable) return; + if (!targets.some((rx) => rx.test(url.href))) return; + let randomInstance; let path; if (frontend == 'searx') { @@ -171,7 +172,7 @@ function redirect(url) { randomInstance = commonHelper.getRandomInstance(instancesList) path = "/"; } - if (frontend == 'whoogle') { + else if (frontend == 'whoogle') { let instancesList if (protocol == 'normal') instancesList = [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects]; if (protocol == 'tor') instancesList = [...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects]; @@ -179,6 +180,10 @@ function redirect(url) { randomInstance = commonHelper.getRandomInstance(instancesList) path = "/search"; } + else if (frontend == 'startpage') { + randomInstance = redirects.startpage.normal; + path = "/do/search"; + } let searchQuery = ""; url.search.slice(1).split("&").forEach((input) => { @@ -282,7 +287,6 @@ async function init() { } export default { - isSearch, getDisable, setDisable, |