百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

foxr

> 测试质量
开源

Node.js API 用于控制 Firefox

798 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Node.js API 用于控制 Firefox

foxr

Node.js API 用于控制 Firefox。

  • 通过 远程协议 使用内置的 Marionette
  • 不需要 Selenium WebDriver
  • 与 无头模式 兼容
  • Puppeteer API 的兼容子集 目前,Foxr 更多是一个概念验证, 工作正在进行中。

示例

运行本地安装的 Firefox:

bash
/path/to/firefox -headless -marionette -safe-mode

或者是 docker 包版本:

bash
docker run -it --rm --shm-size 2g -p 2828:2828 deepsweet/firefox-headless-remote:68
javascript
import foxr from 'foxr'
// const foxr = require('foxr').default

(async () => {
  try {
    const browser = await foxr.connect()
    const page = await browser.newPage()

    await page.goto('https://example.com')
    await page.screenshot({ path: 'example.png' })
    await browser.close()
  } catch (error) {
    console.error(error)
  }
})()

安装

bash
yarn add --dev foxr
# or
npm install --save-dev foxr

API

Foxr

connect

连接到 Marionette 端点。

typescript
type TConnectOptions = {
  host?: string,
  port?: number,
  defaultViewport?: {
    width?: number,
    height?: number
  }
}

foxr.connect(options?: TConnectOptions): Promise
  • host – 默认为 'localhost'

Issues· 32 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptfirefoxheadlessmarionettepuppeteer

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类测试质量
定价开源

> 相关工具

J
Jest
JavaScript 测试框架
P
Playwright
现代端到端测试框架
E
eslint-plugin-test-selectors
Enforces that data-test-id attributes are added to interactive DOM elements (JSX) to help with UI testing. JSX only.