browser_set_dialog_action
Configure automatic handling for JavaScript dialogs (alert, confirm, prompt, beforeunload). Set once and all future dialogs of that type are handled automatically. Useful for preventing dialog interruptions during automated browsing. Each dialog type can have a different action.
Usage Example
Parameters
Required
context_idstringrequiredThe unique identifier of the browser context (e.g., 'ctx_000001')
dialog_typeenumalertconfirmpromptbeforeunloadType of JavaScript dialog to configure: 'alert' (message display), 'confirm' (yes/no), 'prompt' (text input), 'beforeunload' (page leave warning)
actionenumacceptdismissaccept_with_textwaitHow to automatically handle this dialog type: 'accept' clicks OK/Yes, 'dismiss' clicks Cancel/No, 'accept_with_text' accepts and provides text input (for prompts), 'wait' holds the dialog for manual handling via browser_handle_dialog
Optional
prompt_textstringDefault text to enter when accepting prompt dialogs. Only used when dialog_type='prompt' and action='accept_with_text'. Leave empty for blank input
Response
Returns a JSON object with the operation result.
{
"success": true,
"result": <value>
}