summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-02-10 01:31:47 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-02-10 01:31:47 +0200
commit14b9f4a82781b9a5044e22437f6b0b02af67a120 (patch)
tree26761e13bc7bcb9c3170c477ca0fe8efe43de813 /ext
parent460d306f60fa745368c8249e4bc4bdb0d0448f25 (diff)
preserve search page mode on manual search
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/search.js8
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);
}