Skip to content

Commit b28dc52

Browse files
committed
Update
1 parent a0662fb commit b28dc52

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

searxng.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
const INSTANCES_URL = 'https://searx.space/data/instances.json';
2323
const INSTANCES = ['search.charliewhiskey.net', 'search.im-in.space', 'search.ipsys.bf', 'search.mycotrip.tech', 'search.ononoki.org', 'search.pollorebozado.com', 'search.rowie.at', 'search.system51.co.uk', 'search.undertale.uk', 'search.url4irl.com', 'searx.bndkt.io', 'searx.dresden.network', 'searx.foss.family', 'searx.oloke.xyz', 'searx.ox2.fr', 'searx.party', 'searx.perennialte.ch', 'searx.tiekoetter.com', 'searx.zhenyapav.com', 'searxng.shreven.org']
2424
const LANGUAGES = ['en'];
25+
const GET = '0';
2526
const TIMEOUT = 5000;
2627
const ATTEMPTS = 10;
2728
const CUSTOM_PARAMS = ['attempts', 'languages', 'fast', 'instances', 'timeout'];
@@ -157,7 +158,7 @@
157158
newParams.set('image_proxy', params.get('image_proxy') || 'True');
158159

159160
const timeout = Number(params.get('timeout')) || TIMEOUT;
160-
const getMethod = params.get('get') === '1';
161+
const getMethod = (params.get('get') || GET) === '1';
161162
for (let i = 0; i < shuffledInstances.length; i++) schedule(_ => {
162163
window.stop();
163164
if (i > 0) {
@@ -240,7 +241,7 @@
240241
document.body.appendChild(form);
241242
input.focus();
242243

243-
const pageUrl = `${window.location.protocol}//${window.location.pathname}`;
244+
const pageUrl = window.location.toString();
244245
const div = document.createElement('div');
245246
div.innerHTML = `
246247
<p>This page redirects to a <a rel="noopener noreferrer nofollow" href="${pageUrl}#q=" onclick="window.location.replace('${pageUrl}#q=')">random SearXNG</a> instance.</p>
@@ -254,17 +255,18 @@
254255
<ul>
255256
<li>normal SearXNG GET/POST <a rel="noopener" target="_blank" href="https://docs.searxng.org/dev/search_api.html">parameters</a> (<code>safesearch=0</code> and <code>image_proxy=True</code> are set by default)</li>
256257
<li><code>languages</code> limit query-based language detection, fallbacks to the first language in the list when not detected (use <code>all</code> to fallback to SearXNG-based language detection instead); comma-separated, default is <code>${LANGUAGES.join(',')}</code></li>
257-
<li><code>get</code> pass parameters to the instance using GET method; default is <code>0</code></li>
258+
<li><code>get</code> pass parameters to the instance using GET method; default is <code>${GET}</code></li>
258259
<li><code>timeout</code> in milliseconds until attempting the next instance; default is <code>${TIMEOUT}</code></li>
259260
<li><code>attempts</code> how many instances to try; default is <code>${ATTEMPTS}</code></li>
260261
<li><code>fast</code> always use the predefined SearXNG instances rather than just as a fallback (no <a rel="noopener" target="_blank" href="${INSTANCES_URL}">API</a> will be used); default is <code>0</code></li>
261262
<li><code>instances</code> the predefined instances (use <code>fast=1</code> to force the use of them); comma-separated, default is <code>${INSTANCES.join(',')}</code></li>
262263
</ul>
263264
${pageUrl.startsWith('file:') ? '' : `<p>For local use (doesn't require any server): <code>wget ${pageUrl} -O searxng.html</code></p>`}
265+
<p>License: MIT/Apache-2.0</p>
264266
<p>Additionally can be combined with the Violentmonkey userscripts:</p>
265267
<ul>
266268
<li><a rel="noopener" target="_blank" href="https://userscripts.codonaft.com/redirect-searxng-on-failure.js">redirect-searxng-on-failure.js</a> — turn search failures into the redirects</li>
267-
<li><a rel="noopener" target="_blank" href="https://userscripts.codonaft.com/force-searxng-parameters.js">force-searxng-parameters.js</a> — always enable image proxy and disable SafeSearch</li>
269+
<li><a rel="noopener" target="_blank" href="https://userscripts.codonaft.com/force-searxng-parameters.js">force-searxng-parameters.js</a> — always enable image proxy, disable SafeSearch and more</li>
268270
</ul>
269271
<hr>
270272
<p>Existing alternatives:</p>

0 commit comments

Comments
 (0)