{"record":{"id":"a6b3cdf7825e5118","repo":"Mintplex-Labs/anything-llm","slug":"no-browser-tab-matching-targeturl-open-tabs-a6b3cd","errorCode":null,"errorMessage":"No browser tab matching \"${targetUrl}\". Open tabs:\n${openTabs}","messagePattern":"No browser tab matching \"(.+?)\"\\. Open tabs:\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-computer/services/interface-service/utils/cdp-input.js","lineNumber":111,"sourceCode":"\n    // Determine target URL filter (always last arg if it doesn't look like a coordinate/text)\n    let targetUrl = \"\";\n    if (action === \"click\") {\n      targetUrl = process.argv[5] || \"\";\n    } else if (action === \"type\") {\n      targetUrl = process.argv[4] || \"\";\n    } else if (action === \"key\") {\n      targetUrl = process.argv[4] || \"\";\n    }\n\n    let target = pages[pages.length - 1];\n    if (targetUrl) {\n      const match = pages.find(\n        (p) => p.url.includes(targetUrl) || p.title.toLowerCase().includes(targetUrl.toLowerCase())\n      );\n      if (!match) {\n        const openTabs = pages.map((p) => `- ${p.title} ${p.url}`).join(\"\\n\");\n        throw new Error(`No browser tab matching \"${targetUrl}\". Open tabs:\\n${openTabs}`);\n      }\n      if (match) target = match;\n    }\n\n    const { sessionId } = await cdpSend(ws, \"Target.attachToTarget\", {\n      targetId: target.targetId,\n      flatten: true,\n    });\n\n    if (action === \"click\") {\n      const x = parseFloat(process.argv[3]);\n      const y = parseFloat(process.argv[4]);\n      if (isNaN(x) || isNaN(y)) throw new Error(\"click requires <x> <y> coordinates\");\n\n      // Move mouse to position first (triggers hover states)\n      await cdpSend(ws, \"Input.dispatchMouseEvent\", {\n        type: \"mouseMoved\", x, y\n      }, sessionId);","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/open-computer/services/interface-service/utils/cdp-input.js#L93-L129","documentation":"Thrown when an optional target_url argument is supplied to cdp-input.js but none of the open page targets match it. Matching is case-insensitive on the page title substring OR case-sensitive on the URL substring. The error message lists every open tab (title + url) so the caller can correct the filter. It prevents input from being dispatched to the wrong tab when a specific tab was requested.","triggerScenarios":"Passing a 4th/5th argv filter (e.g. `node cdp-input.js click 10 20 myapp.local`) where 'myapp.local' is not a substring of any open tab's URL or title. Also triggered by a typo in the filter, a trailing slash mismatch, or when the intended tab navigated away to a different URL before the command ran.","commonSituations":"The target SPA changed its route so the URL substring no longer matches; the title changed dynamically; the filter used 'https://' prefix but tabs store a normalized URL; multiple Chromium instances and the script connected to the wrong one.","solutions":["Read the 'Open tabs' list in the error and copy an exact URL or title substring.","Drop the trailing target_url argument entirely so the script defaults to the last open page.","Use a shorter, stable substring of the URL (e.g. the hostname without scheme/path).","Confirm you are talking to the right Chromium instance on port 9222."],"exampleFix":"// before\nnode cdp-input.js click 100 200 https://app.example.com/dashboard/\n// after — omit filter to use the last tab, or use a stable substring\nnode cdp-input.js click 100 200 app.example.com","handlingStrategy":"validation","validationCode":"const targets = JSON.parse(await httpGet('http://127.0.0.1:9222/json'));\nconst pages = targets.filter((t) => t.type === 'page');\nconst ok = pages.some(\n  (p) => p.url.includes(targetUrl) || p.title.toLowerCase().includes(targetUrl.toLowerCase())\n);\nif (!ok) throw new Error(`No tab matches '${targetUrl}'. Open: ${pages.map(p => p.url).join(', ')}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer a stable hostname substring over a full URL with scheme/path.","Omit the target_url filter when you want the most recently used tab.","Log available tabs before dispatching input to catch mismatches early."],"tags":["cdp","browser-automation","target-matching","chromium"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}