🐛 (#267) Fix custom search engine option

This commit is contained in:
Alicia Sykes 2021-10-05 20:30:02 +01:00
parent 4117586b91
commit 96f6a845a2

View File

@ -129,7 +129,10 @@ export default {
const searchEngine = searchPrefs.searchEngine || defaultSearchEngine;
// Use either search bang, or preffered search engine
const desiredSearchEngine = searchBang || searchEngine;
let searchUrl = findUrlForSearchEngine(desiredSearchEngine, searchEngineUrls);
const isCustomSearch = (searchPrefs.searchEngine === 'custom' && searchPrefs.customSearchEngine);
let searchUrl = isCustomSearch
? searchPrefs.customSearchEngine
: findUrlForSearchEngine(desiredSearchEngine, searchEngineUrls);
if (searchUrl) { // Append search query to URL, and launch
searchUrl += encodeURIComponent(stripBangs(this.input, bangList));
this.launchWebSearch(searchUrl, openingMethod);