mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
fix search
This commit is contained in:
parent
1ce03e414e
commit
b8d19427cf
@ -476,16 +476,9 @@ window.search = window.search || {};
|
||||
const branch = lang === 'en' ? 'master' : lang;
|
||||
const baseRemote = `https://raw.githubusercontent.com/HackTricks-wiki/hacktricks/${branch}`;
|
||||
const remoteJs = `${baseRemote}/searchindex.js`;
|
||||
const localJs = './searchindex.js';
|
||||
const localJs = '/searchindex.js';
|
||||
const TIMEOUT_MS = 5_000;
|
||||
|
||||
/* ───────── helpers ───────── */
|
||||
const fetchWithTimeout = (url, opt = {}) =>
|
||||
Promise.race([
|
||||
fetch(url, opt),
|
||||
new Promise((_, r) => setTimeout(() => r(new Error('timeout')), TIMEOUT_MS))
|
||||
]);
|
||||
|
||||
const loadScript = src =>
|
||||
new Promise((resolve, reject) => {
|
||||
const s = document.createElement('script');
|
||||
|
Loading…
x
Reference in New Issue
Block a user