{"record":{"id":"5b4cbdd693b4d888","repo":"n8n-io/n8n","slug":"operation-not-supported-dialog","errorCode":null,"errorMessage":"Operation not supported: dialog","messagePattern":"Operation not supported: dialog","errorType":"exception","errorClass":"UnsupportedOperationError","httpStatus":null,"severity":"warning","filePath":"packages/@n8n/mcp-browser/src/adapters/agent-browser.ts","lineNumber":426,"sourceCode":"\t\t\t\t'scroll',\n\t\t\t\toptions?.direction ?? 'down',\n\t\t\t\tString(options?.amount ?? 300),\n\t\t\t]);\n\t\t}\n\t}\n\n\tasync upload(\n\t\t_pageId: string,\n\t\t_target: ElementTarget | undefined,\n\t\t_files: string[],\n\t): Promise<void> {\n\t\tawait Promise.resolve();\n\t\tthrow new UnsupportedOperationError('upload', this.name);\n\t}\n\n\tasync dialog(_pageId: string, _action: 'accept' | 'dismiss', _text?: string): Promise<string> {\n\t\tawait Promise.resolve();\n\t\tthrow new UnsupportedOperationError('dialog', this.name);\n\t}\n\n\t// =========================================================================\n\t// Inspection\n\t// =========================================================================\n\n\tasync snapshot(\n\t\tpageId: string,\n\t\t_target?: ElementTarget,\n\t\tinteractive = true,\n\t): Promise<SnapshotResult> {\n\t\tawait this.switchToTab(pageId);\n\t\tconst args = interactive ? ['snapshot', '-i'] : ['snapshot'];\n\t\tconst response = await this.run(args);\n\t\tconst tree =\n\t\t\ttypeof response.data === 'string' ? response.data : JSON.stringify(response.data ?? '');\n\t\tconst refCount = (tree.match(/@e\\d+/g) ?? []).length;\n\t\treturn { tree: tree || '(empty page)', refCount };","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/mcp-browser/src/adapters/agent-browser.ts#L408-L444","documentation":"Thrown as UnsupportedOperationError('dialog', 'agent-browser') by the agent-browser adapter's dialog() stub. The agent-browser CLI has no JavaScript dialog (alert/confirm/prompt) handling, so the adapter explicitly rejects the operation. UnsupportedOperationError extends McpBrowserError. The Playwright adapter supports dialog handling; agent-browser does not.","triggerScenarios":"Calling adapter.dialog(pageId, 'accept' | 'dismiss', text?) on an AgentBrowserAdapter instance. The method awaits a resolved promise then throws synchronously.","commonSituations":"A page showed a JS alert/confirm and the tool layer tried to dismiss it generically; migrating from Playwright adapter to agent-browser; an LLM emitted a dialog tool call against an agent-browser session.","solutions":["Switch to the Playwright adapter for sessions that may encounter JS dialogs.","Gate dialog handling behind adapter.name === 'playwright' before calling.","For agent-browser, dismiss dialogs manually via evaluate() that overrides window.alert/confirm, or accept them in the browser UI."],"exampleFix":"// before\nawait adapter.dialog(pageId, 'accept');\n\n// after — dismiss via eval on agent-browser\nif (adapter.name === 'agent-browser') {\n  await adapter.evaluate(pageId, 'window.confirm = () => true;');\n} else {\n  await adapter.dialog(pageId, 'accept');\n}","handlingStrategy":"validation","validationCode":"function adapterSupportsDialog(name: string): boolean {\n  return name === 'playwright';\n}","typeGuard":"function supportsDialog(adapter: Adapter): boolean {\n  return adapter.name !== 'agent-browser';\n}","tryCatchPattern":null,"preventionTips":["Check adapter.name before calling dialog().","On agent-browser, override window.alert/confirm via evaluate() as a workaround.","Use the Playwright adapter for sessions that may hit JS dialogs."],"tags":["mcp-browser","agent-browser","unsupported","dialog","capability"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}