From 6bb8ba7695c44dd094027a7527b6c0550ec8309e Mon Sep 17 00:00:00 2001 From: Samuel Hutchinson Date: Mon, 22 Aug 2022 15:13:04 +1000 Subject: [PATCH] Initial functionality google-search-suggestions Added search url (for english only). Tenatitively disabled search engine check in instantAnswerPlugin --- js/searchbar/instantAnswerPlugin.js | 6 +++--- js/util/searchEngine.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/searchbar/instantAnswerPlugin.js b/js/searchbar/instantAnswerPlugin.js index 59408d304..4fe8471df 100644 --- a/js/searchbar/instantAnswerPlugin.js +++ b/js/searchbar/instantAnswerPlugin.js @@ -61,9 +61,9 @@ var instantAnswers = { function showSearchbarInstantAnswers (text, input, event) { // only make requests to the DDG api if DDG is set as the search engine - if (searchEngine.getCurrent().name !== 'DuckDuckGo') { - return - } + // if (searchEngine.getCurrent().name !== 'DuckDuckGo') { + // return + // } // don't make a request if the searchbar has already closed diff --git a/js/util/searchEngine.js b/js/util/searchEngine.js index b955a37f0..4341de961 100644 --- a/js/util/searchEngine.js +++ b/js/util/searchEngine.js @@ -20,6 +20,7 @@ var searchEngines = { Google: { name: 'Google', searchURL: 'https://www.google.com/search?q=%s', + suggestionsURL: 'https://suggestqueries.google.com/complete/search?client=firefox&q=%s&hl=en', queryParam: 'q' }, Bing: {