MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / waitFor

Function waitFor

e2e/desktop-packaged/linux-vm/repro.mjs:63–71  ·  view source on GitHub ↗
(label, fn, timeoutMs)

Source from the content-addressed store, hash-verified

61};
62
63const waitFor = async (label, fn, timeoutMs) => {
64 const deadline = Date.now() + timeoutMs;
65 for (;;) {
66 const value = await fn().catch(() => null);
67 if (value) return value;
68 if (Date.now() >= deadline) throw new Error(`timed out waiting for ${label}`);
69 await delay(250);
70 }
71};
72
73// --- minimal CDP page client over the built-in WebSocket -------------------
74class Cdp {

Callers 2

launchAppFunction · 0.70
mainFunction · 0.70

Calls 1

delayFunction · 0.70

Tested by

no test coverage detected