forked from Ponysearch/Ponysearch
[fix] opensearch on chromium for android (#2132)
This commit is contained in:
parent
27d74826f1
commit
a5e6423c39
2 changed files with 4 additions and 1 deletions
|
@ -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}" />
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue