summaryrefslogtreecommitdiff
path: root/searx/templates
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
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')
-rw-r--r--searx/templates/__common__/opensearch.xml4
-rw-r--r--searx/templates/__common__/opensearch_response_rss.xml2
-rw-r--r--searx/templates/courgette/base.html2
-rw-r--r--searx/templates/legacy/base.html2
-rw-r--r--searx/templates/oscar/base.html2
-rw-r--r--searx/templates/simple/base.html2
6 files changed, 9 insertions, 5 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>
diff --git a/searx/templates/courgette/base.html b/searx/templates/courgette/base.html
index f4c61dac2..468b817c5 100644
--- a/searx/templates/courgette/base.html
+++ b/searx/templates/courgette/base.html
@@ -22,7 +22,7 @@
{% endblock %}
{% block meta %}{% endblock %}
{% block head %}
- <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
+ <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/>
{% endblock %}
<script type="text/javascript">
searx = {};
diff --git a/searx/templates/legacy/base.html b/searx/templates/legacy/base.html
index 152cd77f3..1e5232274 100644
--- a/searx/templates/legacy/base.html
+++ b/searx/templates/legacy/base.html
@@ -17,7 +17,7 @@
{% endblock %}
{% block meta %}{% endblock %}
{% block head %}
- <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
+ <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/>
{% endblock %}
</head>
<body class="{{ endpoint }}_endpoint" >
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html
index a3bfa5249..7b3d33f7a 100644
--- a/searx/templates/oscar/base.html
+++ b/searx/templates/oscar/base.html
@@ -37,7 +37,7 @@
{% block head %}
{% endblock %}
- <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
+ <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/>
<noscript>
<style type="text/css">
.tab-content > .active_if_nojs, .active_if_nojs {display: block !important; visibility: visible !important;}
diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html
index 7a624a4b3..10fb424bf 100644
--- a/searx/templates/simple/base.html
+++ b/searx/templates/simple/base.html
@@ -29,7 +29,7 @@
data-no-item-found="{{ _('No item found') }}"></script>
<!--<![endif]-->
{% block head %}
- <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
+ <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ opensearch_url }}"/>
{% endblock %}
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" />
</head>