[firefox-devtools-mcp] beforeunload dialogs are disabled
Categories
(Developer Infrastructure :: Firefox MCP, defect)
Tracking
(Not tracked)
People
(Reporter: hbenl, Unassigned)
References
(Depends on 1 open bug)
Details
When the MCP connects to a Firefox instance, beforeunload dialogs get disabled - tabs always close without prompting.
When I start Firefox manually with --marionette --remote-debugging-port, beforeunload dialogs work as expected but as soon as I connect the MCP to it, they are disabled (not only when using the close_page tool but also when closing manually). Once the MCP disconnects, they work again.
Updated•4 days ago
|
Comment 1•4 days ago
|
||
This is most likely because (checking https://github.com/mozilla/firefox-devtools-mcp/pull/235), we are setting the capability as a string "ignore".
Which triggers the classic-only prompt handling which has no support for beforeUnload.
Instead of caps.setAlertBehavior(UserPromptHandler.IGNORE);, can you use caps.set('unhandledPromptBehavior', { default: 'ignore' });?
It should really handle all prompt types.
| Reporter | ||
Comment 2•3 days ago
|
||
Yes, that change enabled beforeunload dialogs, I've updated https://github.com/mozilla/firefox-devtools-mcp/pull/235.
But I still see some issues:
- the (currently skipped)
close_pagetest now fails because theaccept_dialogtool hangs. In fact all tools seem to hang inensureConnected()after that dialog opens, perhaps because it's using classic commands. - if I change
new_pagetonavigate_page(andpageIdx: 1topageIdx: 0) in that test, it still fails because the beforeunload dialog isn't shown.
Comment 3•3 days ago
|
||
Thanks for checking, we discussed it a bit on Slack. Any leftover classic command will still fail if a prompt is open.
From this chat, we agreed to enable beforeunload dialogs after the migration from classic to bidi is completed.
Blocking this bug on the bidi migration meta.
Description
•