diff options
author | Alexandre Flament <alex@al-f.net> | 2020-10-05 15:38:05 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2020-10-06 00:54:37 +0200 |
commit | bfdad7bc0f867f67675c1d8c539c58e82f450c58 (patch) | |
tree | cf583c06d5f2b7cfb62626efac76bc4644788e14 /searx/webapp.py | |
parent | 584760cf5419051bd3f37e733147e048356f7ffc (diff) | |
download | searxng-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-x | searx/webapp.py | 3 |
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) |