Skip to main content
Glama

dialog_auto_handle

Auto-handle native browser dialogs (alerts, confirms, prompts, beforeunload) with persistent accept/dismiss settings. Update action, types, or disable without re-arming.

Instructions

⭐ Install a PERSISTENT auto-handler for native browser dialogs. Unlike dialog_handle (one-shot, action baked in at arm time), this one stays armed across many dialogs and reads its config at fire time — call again with new action/types to update without re-arming.

Args:
    action: "accept" (Leave / OK) or "dismiss" (Cancel / Stay)
    enabled: True to arm, False to disable (config preserved)
    types: optional list to scope handling — any of:
           ["alert", "confirm", "prompt", "beforeunload"]
           None (default) = handle all types.
    text: prompt response when action="accept" on prompt() dialogs;
          also basic-auth "user:pass" for HTTP 401.

Common patterns:
    # Form pages with "unsaved changes" guard — auto-leave forever
    dialog_auto_handle(action="accept", types=["beforeunload"])

    # Pages that spam alert() — auto-OK
    dialog_auto_handle(action="accept", types=["alert"])

    # Disable when done
    dialog_auto_handle(enabled=False)

Native dialogs only (Chrome's own card UI). HTML/CSS modal overlays
are regular DOM — use click_text("Cancel") / click_role for those.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoaccept
enabledNo
typesNo
textNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RobithYusuf/mcp-stealth-chrome'

If you have feedback or need assistance with the MCP directory API, please join our Discord server