{"record":{"id":"14ec773db4d73481","repo":"CloakHQ/CloakBrowser","slug":"humanized-dom-read-requires-an-active-isolated-wor","errorCode":null,"errorMessage":"Humanized DOM read requires an active isolated world","messagePattern":"Humanized DOM read requires an active isolated world","errorType":"exception","errorClass":"StealthWorldUnavailableError","httpStatus":null,"severity":"error","filePath":"js/src/human/actionability.ts","lineNumber":129,"sourceCode":"  const world = getWorld(pageOrFrame);\n  if (!world) throw new StealthWorldUnavailableError();\n\n  const { status, data } = await evalParsed(world, buildActionableJs(selector));\n  if (status === UNSUPPORTED) throw new UnsupportedHumanizeSelectorError(selector);\n  if (status === EVALUATION_FAILED) throw new StealthEvaluationError(selector);\n  if (status === NOT_FOUND) throw new ElementNotAttachedError(selector);\n  if (status !== OK || !data) throw new StealthEvaluationError(selector);\n  if (checks.has('visible') && !data.visible) throw new ElementNotVisibleError(selector);\n  if (checks.has('enabled') && !data.enabled) throw new ElementNotEnabledError(selector);\n  if (checks.has('editable') && !data.editable) throw new ElementNotEditableError(selector);\n}\n\nasync function readBox(\n  pageOrFrame: Page | Frame,\n  selector: string,\n): Promise<{ x: number; y: number; width: number; height: number } | null> {\n  const world = getWorld(pageOrFrame);\n  if (!world) throw new StealthWorldUnavailableError();\n\n  const { status, data } = await evalParsed(world, buildBoxJs(selector));\n  if (status === OK && data?.box) return data.box;\n  if (status === NOT_FOUND) return null;\n  if (status === UNSUPPORTED) throw new UnsupportedHumanizeSelectorError(selector);\n  throw new StealthEvaluationError(selector);\n}\n\nexport async function ensureActionable(\n  pageOrFrame: Page | Frame,\n  selector: string,\n  checks: ReadonlySet<CheckName>,\n  timeout: number = 30000,\n  force: boolean = false,\n): Promise<void> {\n  if (force) return;\n\n  const deadline = Date.now() + timeout;","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/CloakHQ/CloakBrowser/blob/d6bad5de261bedf025280ace1d14e800aee13923/js/src/human/actionability.ts#L111-L147","documentation":"readBox calls getWorld(pageOrFrame) to find the page's isolated (stealth) world; when it returns null the humanized geometry read cannot run and this error is thrown. It means no isolated world is currently attached to that page/frame.","triggerScenarios":"Calling humanClick/humanHover (which read the element box via readBox) before the isolated world is initialized, after the world was torn down (navigation to a new document, context close), or on a Frame whose parent world binding hasn't propagated.","commonSituations":"Acting immediately after page.goto before world setup completes, running on a freshly attached iframe, browser context recreation, or a race between world injection and the first humanized action.","solutions":["Retry after a short delay or after waitForLoadState — world injection is usually only a beat behind","Ensure the page was created through this library's API so world initialization is wired up","Await a sentinel proving the world binding exists before the first humanized action","Fall back to humanize:false to use Playwright's native path when the world cannot be established"],"exampleFix":"// before\nawait page.goto(url);\nawait humanClick(page, '#go');\n// after\nawait page.goto(url);\nawait page.waitForFunction(() => (window as any).__stealthReady === true);\nawait humanClick(page, '#go');","handlingStrategy":"retry","validationCode":"try { await page.waitForFunction(() => !!(window as any).__stealthWorld, null, { timeout: 3000 }); } catch { /* fall back to humanize:false */ }","typeGuard":"function isStealthWorldUnavailableError(e: unknown): e is StealthWorldUnavailableError {\n  return e instanceof Error && /requires an active isolated world/.test(e.message);\n}","tryCatchPattern":"try { await humanClick(page, sel); } catch (e) { if (isStealthWorldUnavailableError(e)) { await page.waitForTimeout(200); await humanClick(page, sel); } else throw e; }","preventionTips":["Create pages via the library's API so worlds are injected","Wait for world readiness after goto before the first humanized action","Keep a native-Playwright fallback path"],"tags":["isolated-world","initialization","race-condition","stealth"],"backgroundTag":"isolation-world-unavailable","analyzedSha":"d6bad5de261bedf025280ace1d14e800aee13923","analyzedAt":"2026-08-28T14:13:12.918Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}