[firefox-devtools-mcp] Page dialogs are dismissed before accept_dialog or dismiss_dialog can handle them
Categories
(Developer Infrastructure :: Firefox MCP, defect, P2)
Tracking
(Not tracked)
People
(Reporter: jdescottes, Assigned: mattpmerrill)
References
Details
Attachments
(1 external file)
Every confirm() returns false and every prompt() returns null before the agent can act on the dialog. This happens in all modes: launch, --connect-existing and Android.
The session is a WebDriver classic + BiDi session (created with selenium-webdriver, with webSocketUrl). We never request unhandledPromptBehavior, so the WebDriver classic default "dismiss and notify" applies, and Firefox closes each dialog as soon as it opens.
The error message is also unhelpful. When there is no dialog, accept_dialog fails with "Failed to accept dialog: " and nothing after it. Marionette throws NoSuchAlertError with an empty message. The tool looks for "no such alert" in error.message, so its "No active dialog" text never shows. It should check error.name instead. dismiss_dialog has the same problem.
Proposal:
- Request
unhandledPromptBehavior: "ignore", and check how the other tools behave while a dialog is open. - Fix the error handling in both dialog tools.
With "ignore", the agent needs to know that a dialog is open, or the page stays blocked (see Bug 2081600). Bug 2080970 moves the dialog tools to BiDi browsingContext.handleUserPrompt.
| Assignee | ||
Comment 1•1 month ago
|
||
Hi Julian, I'd like to take this one if nobody else has started on it. I'm planning to go with the fix you described: set unhandledPromptBehavior to "ignore" on the session so dialogs stay open until accept_dialog or dismiss_dialog handles them. I'll add a test that opens a confirm() and checks that it's still there before the tool runs. I should have a PR up in the next day or two.
Comment 2•1 month ago
|
||
(via GitHub webhook, authenticated as firefox-devtools-mcp@bots.tld)
| Reporter | ||
Comment 3•1 month ago
|
||
Thanks Matthew, assigning the bug to you! I will take a look at the PR today hopefully :)
Comment 4•23 days ago
|
||
The severity field is not set for this bug.
:jdescottes, could you have a look please?
For more information, please visit BugBot documentation.
| Reporter | ||
Updated•22 days ago
|
Description
•