summaryrefslogtreecommitdiff
path: root/searx/templates/__common__
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/templates/__common__
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/templates/__common__')
-rw-r--r--searx/templates/__common__/opensearch.xml4
-rw-r--r--searx/templates/__common__/opensearch_response_rss.xml2
2 files changed, 5 insertions, 1 deletions
diff --git a/searx/templates/__common__/opensearch.xml b/searx/templates/__common__/opensearch.xml
index 244e10132..e76a14aff 100644
--- a/searx/templates/__common__/opensearch.xml
+++ b/searx/templates/__common__/opensearch.xml
@@ -15,4 +15,8 @@
{% if autocomplete %}
<Url rel="suggestions" type="application/x-suggestions+json" template="{{ host }}autocompleter?q={searchTerms}"/>
{% endif %}
+
+ <Url type="application/opensearchdescription+xml"
+ rel="self"
+ template="{{ opensearch_url }}" />
</OpenSearchDescription>
diff --git a/searx/templates/__common__/opensearch_response_rss.xml b/searx/templates/__common__/opensearch_response_rss.xml
index 3781dd87c..686443c49 100644
--- a/searx/templates/__common__/opensearch_response_rss.xml
+++ b/searx/templates/__common__/opensearch_response_rss.xml
@@ -9,7 +9,7 @@
<opensearch:totalResults>{{ number_of_results }}</opensearch:totalResults>
<opensearch:startIndex>1</opensearch:startIndex>
<opensearch:itemsPerPage>{{ number_of_results }}</opensearch:itemsPerPage>
- <atom:link rel="search" type="application/opensearchdescription+xml" href="{{ base_url }}opensearch.xml"/>
+ <atom:link rel="search" type="application/opensearchdescription+xml" href="{{ opensearch_url }}"/>
<opensearch:Query role="request" searchTerms="{{ q|e }}" startPage="1" />
{% if error_message %}
<item>