mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2025-12-05 20:40:18 -08:00
fix search
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user