SuperAPI AI 工具集

firefox-debug

测试与质量

查看项目

更新于 10-16 02:28

技能介绍

用途:该技能把 Firefox 远程调试协议(RDP)接入开发工作流,通过 mcporter 让智能体操作并调试浏览器。Firefox 默认在 6000 端口通过 WebSocket 暴露 RDP,再由 mcporter 提供给智能体调用。

前提检查(关键):运行 mise x node@20 -- mcporter call 'firefox-devtools.getVersion',应返回 Firefox 版本信息(JSON);若失败说明 Firefox 未在 6000 端口监听。

主要能力:检查器(DOM 操作与查看)、调试器(JavaScript 断点与单步)、控制台(执行脚本与查看日志)、网络(监控与拦截请求)、性能(运行时性能分析)、存储(读取 cookies、localStorage、sessionStorage)。

可用工具:firefox-devtools.getVersion、getTabs、navigateToUrl [url]、takeScreenshot [tabId]、clickElement [tabId, selector]、fillFormField [tabId, selector, value]、getPageContent [tabId]、evaluateScript [tabId, script]、getConsoleOutput [tabId]、getStorage [tabId, storageType]。

典型用法:先调用 getTabs 获取标签页 ID,再执行 navigateToUrl、clickElement、fillFormField、takeScreenshot、evaluateScript、getConsoleOutput、getStorage 等操作。示例调用形式为 mise x node@20 -- mcporter call 'firefox-devtools.getVersion' 与 mise x node@20 -- mcporter call 'firefox-devtools.takeScreenshot(tabId: "<id>")'。

适用场景:检查 Web 应用状态并截图、读取控制台错误、自动化表单测试与验证、检查 localStorage 中的认证令牌、收集性能指标。

限制与排查:需 Firefox 开启远程调试;连接被拒时可用 firefox --remote-debugging-port 6000 & 显式启动;端口占用可改用 7000 并调整 mcporter 配置;官方资料称远程调试开销较小,开启调试的 Firefox 内存占用约增加 10-15%。工具参数与返回格式以实际 mcporter 调用为准,资料未提供收费、价格与跨平台细节。