Open
Bug 2081597
Opened 1 month ago
Updated 2 days ago
[firefox-devtools-mcp] Report pages opened or closed during a tool call
Categories
(Developer Infrastructure :: Firefox MCP, enhancement)
Developer Infrastructure
Firefox MCP
Tracking
(Not tracked)
NEW
People
(Reporter: jdescottes, Unassigned)
References
(Blocks 5 open bugs)
Details
When a tool call opens a page (popup, target=_blank link, window.open) or closes one, the agent is not told. It has to call list_pages to find out.
Add a short ### Changes block to the tool response when pages were opened or closed during the call. Example:
- New page [2] opened: https://example.com/login (not selected, use select_page to switch)
When nothing changed, the response must stay exactly as it is today. This also covers pages closed by the page itself, or by the user in connect-existing mode.
Implementation:
- Update the cached page list from browsingContext.contextCreated and contextDestroyed events, so we do not call refreshTabs() after every tool call. The page order must stay the same as the order refreshTabs() produces.
- In the tool dispatcher (src/index.ts), compare the page list before and after the handler runs, and build the "Changes" block from the difference.
Other bugs in the meta will add more lines to this block...
You need to log in
before you can comment on or make changes to this bug.
Description
•