{"record":{"id":"e52958e5404da8f8","repo":"musistudio/claude-code-router","slug":"label-failed-because-the-browser-tab-is-destroy","errorCode":null,"errorMessage":"${label} failed because the browser tab is destroyed.","messagePattern":"(.+?) failed because the browser tab is destroyed\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/electron/src/main/browser-automation-mcp.ts","lineNumber":2329,"sourceCode":"  } finally {\n    if (attachedHere && webContents.debugger.isAttached()) {\n      try {\n        webContents.debugger.detach();\n      } catch {\n        // Ignore detach errors after the dialog is resolved.\n      }\n    }\n  }\n}\n\nasync function executeJavaScriptWithTimeout<T = unknown>(\n  webContents: WebContents,\n  script: string,\n  timeoutMs: number,\n  label: string\n): Promise<T> {\n  if (webContents.isDestroyed()) {\n    throw new Error(`${label} failed because the browser tab is destroyed.`);\n  }\n  return await withTimeout(\n    webContents.executeJavaScript(script, true) as Promise<T>,\n    timeoutMs,\n    `${label} timed out after ${timeoutMs}ms.`\n  );\n}\n\nasync function withTimeout<T>(promise: Promise<T>, timeoutMs: number, message: string): Promise<T> {\n  let timer: ReturnType<typeof setTimeout> | undefined;\n  try {\n    return await Promise.race([\n      promise,\n      new Promise<T>((_resolve, reject) => {\n        timer = setTimeout(() => reject(new Error(message)), Math.max(0, timeoutMs));\n      })\n    ]);\n  } finally {","sourceCodeStart":2311,"sourceCodeEnd":2347,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/electron/src/main/browser-automation-mcp.ts#L2311-L2347","documentation":"Error \"${label} failed because the browser tab is destroyed.\" thrown in musistudio/claude-code-router.","triggerScenarios":"Thrown at packages/electron/src/main/browser-automation-mcp.ts:2329 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}