Variable for default search engine

Added a variable for default search engine (leaving Google for compatibility reasons), and added a case for Google if something else is defined.
This commit is contained in:
k 2021-09-01 20:05:39 +03:00 committed by GitHub
parent 115cbb7bbc
commit 7b1b2985ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
var sindex = 0; var sindex = 0;
var cycle = false; var cycle = false;
var sengine = "https://www.google.com/?q="; // Default search engine
function start() { function start() {
var query = getParameterByName('q'); var query = getParameterByName('q');
@ -92,6 +93,10 @@ function search(text) {
case "y": case "y":
window.location = "https://www.youtube.com/results?search_query=" + subtext; window.location = "https://www.youtube.com/results?search_query=" + subtext;
break; break;
case "g":
window.location = "https://www.google.com/?q=" + subtext;
break;
} }
} else { } else {
var option = text.substr(1); var option = text.substr(1);