File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55<!DOCTYPE html>
66< html >
7- < head > < meta charset ="utf-8 "> < title > SearXNG Redirector</ title > </ head >
7+ < head >
8+ < meta charset ="utf-8 ">
9+ < link rel ="search " type ="application/opensearchdescription+xml " title ="SearXNG " href ="{{ site.url }}/tools/searxng.xml ">
10+ < title > SearXNG Redirector</ title >
11+ </ head >
812< body >
9- Accepts SearXNG < a target ="_blank " href ="https://docs.searxng.org/dev/search_api.html "> GET parameters</ a > .
1013< script type ="module ">
1114import { detectAll } from '/assets/js/vendor/tinyld.min.js' ;
1215
1619const params = new URLSearchParams ( window . location . search ) ;
1720
1821const loadInstances = async ( ) => {
19- const fallbacks = FALLBACKS . map ( i => `https://${ i } /` ) ;
22+ const fallbacks = FALLBACKS . map ( i => `https://${ i } /` ) ; // TODO: load from cache
2023 if ( params . get ( 'fast' ) === 1 ) return fallbacks ;
2124
2225 const response = await fetch ( 'https://searx.space/data/instances.json' ) ;
8083if ( query ) {
8184 redirect ( targetUrl , query ) ;
8285} else {
86+ document . body . innerHTML = '<p>Accepts SearXNG <a target="_blank" href="https://docs.searxng.org/dev/search_api.html">GET parameters</a> + special optional parameter <code>fast=1</code> to use hardcoded instances.</p>' ;
87+ //window.external.AddSearchProvider('searxng.xml'); // FIXME
88+
8389 const input = document . createElement ( 'input' ) ;
8490 const form = document . createElement ( 'form' ) ;
8591
Original file line number Diff line number Diff line change 1+ ---
2+ permalink: /tools/searxng.xml
3+ ---
4+
5+ <?xml version =" 1.0" encoding =" UTF-8" ?>
6+ <OpenSearchDescription xmlns =" http://a9.com/-/spec/opensearch/1.1/" >
7+ <ShortName >SearXNG</ShortName >
8+ <Description >SearXNG Redirector</Description >
9+ <InputEncoding >UTF-8</InputEncoding >
10+ <Image width =" 32" height =" 32" type =" image/png" >assets/favicon-32x32.png</Image >
11+ <Url type =" text/html" template =" {{ site.url }}/tools/searxng?q= {searchTerms}& fast= 1& image_proxy= True" />
12+ </OpenSearchDescription >
You can’t perform that action at this time.
0 commit comments