diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2020-02-10 01:31:47 +0200 |
---|---|---|
committer | siikamiika <siikamiika@users.noreply.github.com> | 2020-02-10 01:31:47 +0200 |
commit | 14b9f4a82781b9a5044e22437f6b0b02af67a120 (patch) | |
tree | 26761e13bc7bcb9c3170c477ca0fe8efe43de813 | |
parent | 460d306f60fa745368c8249e4bc4bdb0d0448f25 (diff) |
preserve search page mode on manual search
-rw-r--r-- | ext/bg/js/search.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 37c96934..4da27513 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -152,9 +152,13 @@ class DisplaySearch extends Display { e.preventDefault(); const query = this.query.value; + this.queryParser.setText(query); - const queryString = query.length > 0 ? `?query=${encodeURIComponent(query)}` : ''; - window.history.pushState(null, '', `${window.location.pathname}${queryString}`); + + const url = new URL(window.location.href); + url.searchParams.set('query', query); + window.history.pushState(null, '', url.toString()); + this.onSearchQueryUpdated(query, true); } |