diff options
author | Émilien Devos <contact@emiliendevos.be> | 2020-08-18 19:29:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-18 18:29:58 +0200 |
commit | a5e6423c3926a6c9811f11cd3e2b10fa1bbde012 (patch) | |
tree | ea1afcf7ab172da33235fc5358f54bbc1716d4cc /searx | |
parent | 27d74826f1e00302336c8720e014cd4cda871981 (diff) | |
download | searxng-a5e6423c3926a6c9811f11cd3e2b10fa1bbde012.tar.gz searxng-a5e6423c3926a6c9811f11cd3e2b10fa1bbde012.zip |
[fix] opensearch on chromium for android (#2132)
Diffstat (limited to 'searx')
-rw-r--r-- | searx/templates/__common__/opensearch.xml | 2 | ||||
-rwxr-xr-x | searx/webapp.py | 3 |
2 files changed, 4 insertions, 1 deletions
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 @@ <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image> <LongName>searx metasearch</LongName> {% if opensearch_method == 'get' %} - <Url rel="results" type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/> + <Url rel="results" type="text/html" method="get" template="{{ host }}?q={searchTerms}"/> {% else %} <Url rel="results" type="text/html" method="post" template="{{ host }}"> <Param name="q" value="{searchTerms}" /> 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) |