Don't assign mode as a search parameter (#692)

This commit is contained in:
toasted-nutbread 2020-07-26 16:52:45 -04:00 committed by GitHub
parent 208217198e
commit fca0004597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -814,10 +814,13 @@ class Backend {
const {mode='existingOrNewTab', query} = params || {}; const {mode='existingOrNewTab', query} = params || {};
const baseUrl = chrome.runtime.getURL('/bg/search.html'); const baseUrl = chrome.runtime.getURL('/bg/search.html');
const queryParams = {mode}; const queryParams = {};
if (query && query.length > 0) { queryParams.query = query; } if (query && query.length > 0) { queryParams.query = query; }
const queryString = new URLSearchParams(queryParams).toString(); const queryString = new URLSearchParams(queryParams).toString();
const url = `${baseUrl}?${queryString}`; let url = baseUrl;
if (queryString.length > 0) {
url += `?${queryString}`;
}
const isTabMatch = (url2) => { const isTabMatch = (url2) => {
if (url2 === null || !url2.startsWith(baseUrl)) { return false; } if (url2 === null || !url2.startsWith(baseUrl)) { return false; }