{"record":{"id":"8f4e6a0383591787","repo":"CloakHQ/CloakBrowser","slug":"isolated-world-dom-evaluation-failed-for-selecto","errorCode":null,"errorMessage":"Isolated-world DOM evaluation failed for ${selector}","messagePattern":"Isolated-world DOM evaluation failed for (.+?)","errorType":"exception","errorClass":"StealthEvaluationError","httpStatus":null,"severity":"error","filePath":"js/src/human/actionability.ts","lineNumber":116,"sourceCode":"  const idx = Math.min(attempt, BACKOFF_MS.length - 1);\n  return new Promise(resolve => setTimeout(resolve, BACKOFF_MS[idx]));\n}\n\n// ---------------------------------------------------------------------------\n// Pre-scroll actionability\n// ---------------------------------------------------------------------------\n\nasync function stealthActionable(\n  pageOrFrame: Page | Frame,\n  selector: string,\n  checks: ReadonlySet<CheckName>,\n): Promise<void> {\n  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);","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/CloakHQ/CloakBrowser/blob/d6bad5de261bedf025280ace1d14e800aee13923/js/src/human/actionability.ts#L98-L134","documentation":"Thrown by stealthActionable when the isolated-world evaluation of the actionability probe returns EVALUATION_FAILED (or an unexpected status/missing data). It means the injected script ran but the DOM read itself errored, so the library cannot vouch for the element's state.","triggerScenarios":"Calling ensureActionable (directly or via humanClick/humanType/humanFill etc.) when evalParsed(world, buildActionableJs(selector)) returns status === EVALUATION_FAILED, or status !== OK, or data is falsy after the OK check.","commonSituations":"Page navigating or context destroyed mid-evaluation, SPA tearing down DOM while the probe runs, JS exceptions inside the isolated world (e.g. CSP or extension interference), or a corrupted/stale isolated world after a frame detach.","solutions":["Retry the action — transient navigation/DOM races often clear on the next attempt","Verify the page is not navigating while the action runs (await waitForLoadState or a stable selector)","If it reproduces deterministically, test the same selector in the page console; if Playwright's native locator works, pass humanize:false to bypass the isolated-world probe","Check for iframe/frame confusion — ensure you pass the correct Page or Frame to the humanized API"],"exampleFix":"// before\nawait humanClick(page, '#submit');\n// after\nawait page.waitForLoadState('networkidle');\nawait humanClick(page, '#submit', { humanize: false }); // fallback if world is flaky","handlingStrategy":"retry","validationCode":"await page.waitForLoadState('domcontentloaded'); // avoid evaluating mid-navigation","typeGuard":"function isStealthEvaluationError(e: unknown): e is StealthEvaluationError {\n  return e instanceof Error && /Isolated-world DOM evaluation failed/.test(e.message);\n}","tryCatchPattern":"try { await humanClick(page, sel); } catch (e) { if (isStealthEvaluationError(e)) { await page.waitForTimeout(250); await humanClick(page, sel); } else throw e; }","preventionTips":["Stabilize the page (waitForLoadState) before humanized actions","Avoid triggering actions mid-navigation","Keep a humanize:false fallback path for flaky pages"],"tags":["isolated-world","dom-evaluation","playwright","stealth","actionability"],"backgroundTag":"page-evaluation-failed","analyzedSha":"d6bad5de261bedf025280ace1d14e800aee13923","analyzedAt":"2026-08-28T14:13:12.918Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}