File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22// @name Redirect SearXNG On Failure
33// @description Redirect to a random SearXNG instance in case of error and empty result
44// @icon https://www.google.com/s2/favicons?sz=64&domain=searx.space
5- // @version 0.1
5+ // @version 0.2
66// @downloadURL https://userscripts.codonaft.com/redirect-searxng-on-failure.js
77// ==/UserScript==
88
1818
1919 console . log ( 'SearXNG: no results' ) ;
2020 const url = new URL ( window . location . href ) ;
21- if ( url . host . endsWith ( '.onion' ) ) {
21+ if ( url . hostname . endsWith ( '.onion' ) ) {
2222 url . host = 'codonaftbvv4j5k7nsrdivbdblycqrng5ls2qkng6lm77svepqjyxgid.onion' ;
23- } else if ( url . host . endsWith ( '.i2p' ) ) {
23+ url . protocol = 'http:' ;
24+ } else if ( url . hostname . endsWith ( '.i2p' ) ) {
2425 url . host = 'codonftbnpdkjwyflssto3iklawhuthbe37l6swigegqkyyfmiqa.b32.i2p' ;
26+ url . protocol = 'http:' ;
2527 } else {
2628 url . host = 'codonaft.com' ;
29+ url . protocol = 'https:' ;
2730 }
2831 url . pathname = '/searxng' ;
2932 url . searchParams . set ( 'fast' , '0' ) ;
You can’t perform that action at this time.
0 commit comments