mirror of https://github.com/searxng/searxng.git
[fix] opensearch on chromium for android (#2132)
This commit is contained in:
parent
27d74826f1
commit
a5e6423c39
|
@ -6,7 +6,7 @@
|
||||||
<Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
|
<Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
|
||||||
<LongName>searx metasearch</LongName>
|
<LongName>searx metasearch</LongName>
|
||||||
{% if opensearch_method == 'get' %}
|
{% 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 %}
|
{% else %}
|
||||||
<Url rel="results" type="text/html" method="post" template="{{ host }}">
|
<Url rel="results" type="text/html" method="post" template="{{ host }}">
|
||||||
<Param name="q" value="{searchTerms}" />
|
<Param name="q" value="{searchTerms}" />
|
||||||
|
|
|
@ -463,6 +463,9 @@ def pre_request():
|
||||||
request.errors = []
|
request.errors = []
|
||||||
|
|
||||||
preferences = Preferences(themes, list(categories.keys()), engines, plugins)
|
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
|
request.preferences = preferences
|
||||||
try:
|
try:
|
||||||
preferences.parse_dict(request.cookies)
|
preferences.parse_dict(request.cookies)
|
||||||
|
|
Loading…
Reference in New Issue