From e6df2cf5f4b4870142e0f2daba9fe6fee1b4a015 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter <44733677+ThatOneCalculator@users.noreply.github.com> Date: Sat, 5 Mar 2022 13:55:07 -0800 Subject: [PATCH] Update search.js --- scr/search.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/scr/search.js b/scr/search.js index 6861ba9..b59625f 100644 --- a/scr/search.js +++ b/scr/search.js @@ -3,17 +3,13 @@ window.onload = function() { } function initSearchBar() { - const searchBarInput = document.getElementById("search-bar-input") - - searchBarInput.value = "" - searchBarInput.focus() + document.getElementById("search-bar-input").value = "" + document.getElementById("search-bar-input").focus() - searchBarInput.addEventListener("keypress", (event) => { - if (event.key !== 'Enter') return - - const searchEnginer = "https://www.duckduckgo.com/?q=" - const endQuery = "&atb=v225-7&ia=web" - - document.location = searchEnginer + searchBarInput.value.replace(/\ /g, "+") + endQuery + document.getElementById("search-bar-input").addEventListener("keypress", (event) => { + if (event.key != 'Enter') return + googleSearchUrl = "https://gowogle.voring.me/search?q=" + query = document.getElementById("search-bar-input").value.replace(/\ /g, "+") + document.location = googleSearchUrl + query + "&cookies_disabled=0" }) }