1// Wartet auf ein globales Window-Objekt (z. B. geladene Bibliothek) bis zum Timeout. 2export function waitForGlobal(globalName, timeoutMs = 5000, intervalMs = 100) { 3 const deadline = Date.now() + timeoutMs; 4 5 return new Promise((resolve) => { 6 if (typeof window[globalName] !== 'undefined') { 7 resolve(window[globalName]); 8 return; 9 } 10 11 const interval = window.setInterval(() => { 12 if (typeof window[globalName] !== 'undefined') { 13 window.clearInterval(interval); 14 resolve(window[globalName]); 15 return; 16 } 17 18 if (Date.now() >= deadline) { 19 window.clearInterval(interval); 20 resolve(undefined); 21 } 22 }, intervalMs); 23 }); 24}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.