{"record":{"id":"4df731361cb6beb7","repo":"openclaw/openclaw","slug":"failed-to-open-tab-non-selectable-target","errorCode":null,"errorMessage":"Failed to open tab (non-selectable target)","messagePattern":"Failed to open tab \\(non-selectable target\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/browser/src/browser/server-context.tab-ops.ts","lineNumber":433,"sourceCode":"    ).catch(async (err: unknown) => {\n      if (String(err).includes(\"HTTP 405\")) {\n        return await fetchJson<CdpTarget>(\n          endpoint,\n          cdpActionTimeouts?.httpTimeoutMs ?? CDP_JSON_NEW_TIMEOUT_MS,\n          undefined,\n          getCdpControlPolicy(),\n        );\n      }\n      throw err;\n    });\n\n    opts?.signal?.throwIfAborted();\n    if (!created.id) {\n      throw new Error(\"Failed to open tab (missing id)\");\n    }\n    const resolvedUrl = created.url ?? url;\n    if (!isSelectableCdpBrowserTarget({ url: resolvedUrl, type: created.type })) {\n      throw new Error(\"Failed to open tab (non-selectable target)\");\n    }\n    await assertBrowserNavigationResultAllowed({ url: resolvedUrl, ...ssrfPolicyOpts });\n    const wsUrl = normalizeWsUrl(created.webSocketDebuggerUrl, profile.cdpUrl);\n    const committedUrl = wsUrl\n      ? await waitForCdpCommittedNavigationUrl({\n          wsUrl,\n          configuredCdpUrl: profile.cdpUrl,\n          cdpPolicy: getCdpControlPolicy(),\n          requestedUrl: url,\n          signal: opts?.signal,\n          timeouts: cdpActionTimeouts,\n        })\n      : undefined;\n    opts?.signal?.throwIfAborted();\n    if (!committedUrl) {\n      return await withTabOwnership(\n        {\n          targetId: created.id,","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/openclaw/openclaw/blob/01804a75319da4b69c9ab98ceaa30477e22b8c0b/extensions/browser/src/browser/server-context.tab-ops.ts#L415-L451","documentation":"Plain Error thrown at server-context.tab-ops.ts:433 when the freshly created CDP target fails isSelectableCdpBrowserTarget, i.e. created.type !== \"page\" OR the resolved URL (created.url ?? requested url) starts with a browser-internal scheme (chrome://, chrome-untrusted://, devtools://, edge://, brave://, vivaldi://, opera://). The runtime will not hand internal/devtools targets to user-facing automation.","triggerScenarios":"Calling openTab with a chrome://, devtools://, or edge:// URL; or the CDP /json/new response yields a target whose type is not \"page\" (e.g. \"background_page\", \"service_worker\", \"browser\"). resolvedUrl falls back to the requested url when created.url is absent, so passing an internal scheme directly triggers it.","commonSituations":"A user/agent tries to open chrome://settings or devtools:// to automate browser config; a URL shortener/redirect lands on a browser-internal page; opening a URL that Chrome resolves to a non-page target type. Also seen when the requested url is empty and Chrome creates a service-worker target.","solutions":["Open only real web URLs (http/https) or about:blank; do not pass chrome://, devtools://, or other internal schemes to openTab.","If a redirect lands on an internal page, navigate to the final web URL directly instead of relying on the redirect.","If you genuinely need an internal page, use the CDP target API directly rather than the selectable tab path — but most internal pages are intentionally non-selectable."],"exampleFix":"// before\nawait openTab({ url: \"chrome://settings\" });\n\n// after\nawait openTab({ url: \"https://example.com\" });","handlingStrategy":"validation","validationCode":"import { isSelectableCdpBrowserTarget } from \"./cdp-target-filter.js\";\n\nconst INTERNAL = /^(chrome|chrome-untrusted|devtools|edge|brave|vivaldi|opera):\\/\\//i;\nfunction isOpenableUrl(url) {\n  return /^https?:|^about:blank$/i.test(url) && !INTERNAL.test(url);\n}\nif (!isOpenableUrl(url)) {\n  // reject before calling openTab\n}","typeGuard":"function isOpenableTabUrl(url) {\n  return typeof url === \"string\" && /^(https?:|about:blank$)/i.test(url) &&\n    !/^(chrome|chrome-untrusted|devtools|edge|brave|vivaldi|opera):/i.test(url);\n}","tryCatchPattern":null,"preventionTips":["Never pass chrome://, devtools://, or other internal schemes to openTab.","Validate URLs at the agent/tool boundary before they reach the runtime.","Treat non-page CDP target types as non-user-addressable."],"tags":["cdp","browser","tab-creation","internal-target"],"backgroundTag":null,"analyzedSha":"01804a75319da4b69c9ab98ceaa30477e22b8c0b","analyzedAt":"2026-08-12T04:37:58.197Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}