summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-10-05 15:38:05 +0200
committerAlexandre Flament <alex@al-f.net>2020-10-06 00:54:37 +0200
commitbfdad7bc0f867f67675c1d8c539c58e82f450c58 (patch)
treecf583c06d5f2b7cfb62626efac76bc4644788e14 /searx/webapp.py
parent584760cf5419051bd3f37e733147e048356f7ffc (diff)
downloadsearxng-bfdad7bc0f867f67675c1d8c539c58e82f450c58.tar.gz
searxng-bfdad7bc0f867f67675c1d8c539c58e82f450c58.zip
[fix] opensearch.xml URL contains method and autocomplete parameters
When the user add searx as a search engine, the browser loads the /opensearch.xml URL without the cookies. Without the query parameters, the user preferences are ignored (method and autocomplete). In addition, opensearch.xml is modified to support automatic updates, see https://developer.mozilla.org/en-US/docs/Web/OpenSearch
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index c19d3f3cc..15baf2bdc 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -386,6 +386,9 @@ def render(template_name, override_theme=None, **kwargs):
kwargs['proxify'] = proxify if settings.get('result_proxy', {}).get('url') else None
+ kwargs['opensearch_url'] = url_for('opensearch') + '?' \
+ + urlencode({'method': kwargs['method'], 'autocomplete': kwargs['autocomplete']})
+
kwargs['get_result_template'] = get_result_template
kwargs['theme'] = get_current_theme_name(override=override_theme)