From a5e6423c3926a6c9811f11cd3e2b10fa1bbde012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milien=20Devos?= Date: Tue, 18 Aug 2020 19:29:58 +0300 Subject: [PATCH] [fix] opensearch on chromium for android (#2132) --- searx/templates/__common__/opensearch.xml | 2 +- searx/webapp.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/searx/templates/__common__/opensearch.xml b/searx/templates/__common__/opensearch.xml index 7fdc1f7d8..244e10132 100644 --- a/searx/templates/__common__/opensearch.xml +++ b/searx/templates/__common__/opensearch.xml @@ -6,7 +6,7 @@ {{ urljoin(host, url_for('static', filename='img/favicon.png')) }} searx metasearch {% if opensearch_method == 'get' %} - + {% else %} diff --git a/searx/webapp.py b/searx/webapp.py index f79525d39..4c0eceaaf 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -463,6 +463,9 @@ def pre_request(): request.errors = [] preferences = Preferences(themes, list(categories.keys()), engines, plugins) + user_agent = request.headers.get('User-Agent', '').lower() + if 'webkit' in user_agent and 'android' in user_agent: + preferences.key_value_settings['method'].value = 'GET' request.preferences = preferences try: preferences.parse_dict(request.cookies)