on master help sign in
[enh] chrome opensearch support
174daf7asciimoo
searx/static/css/style.css+3−2
@@ -12,7 +12,7 @@ input { border: 2px solid #666666; color: #444444; padding: 8px; background-col
12
12
13input[type="checkbox"] { visibility: hidden; }
13input[type="checkbox"] { visibility: hidden; }
14
14
15−.checkbox_container { display: inline-block; position: relative; margin: 0; padding-left: 3px; margin: 0 10px; }
15+.checkbox_container { display: inline-block; position: relative; padding-left: 3px; margin: 0 10px; }
16.checkbox_container label {
16.checkbox_container label {
17 cursor: pointer;
17 cursor: pointer;
18}
18}
@@ -53,8 +53,9 @@ input[type="checkbox"] { visibility: hidden; }
53
53
54a { text-decoration: none; }
54a { text-decoration: none; }
55
55
56−.result_title { margin-bottom: 0; }
57
56
57+.result { margin-bottom: 16px; }
58+.result_title { margin-bottom: 0; }
58.result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 50em; }
59.result p { margin-top: 0; padding-top: 0; font-size: 0.8em; max-width: 50em; }
59.result h3 { font-size: 0.9em;}
60.result h3 { font-size: 0.9em;}
60.result { max-width: 70em; }
61.result { max-width: 70em; }
searx/templates/base.html+1−1
@@ -3,7 +3,7 @@
3<head>
3<head>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
4 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5 <meta http-equiv="content-language" content="en" />
5 <meta http-equiv="content-language" content="en" />
6− <meta name="description" content="Searx - a hackable metasearch engine respecting privacy" />
6+ <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
7 <meta name="keywords" content="searx, search, search engine, metasearch, meta search" />
7 <meta name="keywords" content="searx, search, search engine, metasearch, meta search" />
8 <title>searx {% block title %}{% endblock %}</title>
8 <title>searx {% block title %}{% endblock %}</title>
9 <link rel="stylesheet" href="/static/css/style.css" type="text/css" media="screen" charset="utf-8" />
9 <link rel="stylesheet" href="/static/css/style.css" type="text/css" media="screen" charset="utf-8" />
searx/templates/search.html+1−1
@@ -1,4 +1,4 @@
1−<form method="post" action="">
1+<form method="post" action="/">
2 <input type="text" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
2 <input type="text" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
3 <input type="submit" value="search" />
3 <input type="submit" value="search" />
4 <p>
4 <p>
searx/webapp.py+5−2
@@ -37,7 +37,7 @@ opensearch_xml = '''<?xml version="1.0" encoding="utf-8"?>
37 <Description>Search searx</Description>
37 <Description>Search searx</Description>
38 <InputEncoding>UTF-8</InputEncoding>
38 <InputEncoding>UTF-8</InputEncoding>
39 <LongName>searx meta search engine</LongName>
39 <LongName>searx meta search engine</LongName>
40− <Url type="text/html" method="post" template="{host}">
40+ <Url type="text/html" method="{method}" template="{host}">
41 <Param name="q" value="{{searchTerms}}" />
41 <Param name="q" value="{{searchTerms}}" />
42 </Url>
42 </Url>
43</OpenSearchDescription>
43</OpenSearchDescription>
@@ -105,7 +105,10 @@ def fav():
105@app.route('/opensearch.xml', methods=['GET'])
105@app.route('/opensearch.xml', methods=['GET'])
106def opensearch():
106def opensearch():
107 global opensearch_xml
107 global opensearch_xml
108+ method = 'post'
109+ if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
110+ method = 'get'
108− ret = opensearch_xml.format(host=url_for('index', _external=True))
111+ ret = opensearch_xml.format(method=method, host=url_for('index', _external=True))
109 resp = Response(response=ret,
112 resp = Response(response=ret,
110 status=200,
113 status=200,
111 mimetype="application/xml")
114 mimetype="application/xml")