mozilla/gecko-dev
Automation: Marionette, WebDriver BiDi, CDP
Firefox supports several automation surfaces, each implementing a different protocol:
| Protocol | Implementation | Source |
|---|---|---|
| W3C WebDriver (HTTP) | geckodriver ↔ Marionette |
testing/geckodriver/ + testing/marionette/ |
| Marionette (legacy) | In-process server | testing/marionette/ |
| WebDriver BiDi | New W3C bidirectional protocol over WebSocket | remote/webdriver-bidi/ |
| CDP (Chrome DevTools Protocol) | Compatibility surface for Chrome-targeting tools | remote/cdp/ |
The remote/*-protocol implementations live alongside DevTools and share infrastructure.
remote/
remote/
├── server/ # WebSocket server framework
├── shared/ # Common modules (windowtracker, processtracker, ...)
├── webdriver-bidi/ # W3C WebDriver BiDi
├── cdp/ # Chrome DevTools Protocol
├── marionette/ # Browser-side Marionette (Firefox-internal RDP)
├── components/ # Top-level XPCOM components
├── doc/
└── test/Marionette
Marionette is Mozilla's original browser automation protocol. It was W3C-standardized in modified form as the WebDriver classic protocol. geckodriver translates W3C WebDriver requests into Marionette commands. The protocol is JSON line-delimited over TCP (no HTTP framing).
Marionette lives in two halves:
- The server (in-process, in the browser) —
testing/marionette/. - The out-of-process client (
geckodriver) —testing/geckodriver/.
Enable with --marionette on the command line.
WebDriver BiDi
WebDriver BiDi ("Bidirectional WebDriver") is a newer W3C standard that uses WebSockets. It supports event subscriptions, multiple sessions, log streaming, and integrates with browsers without requiring a HTTP-only translation layer.
remote/webdriver-bidi/ implements:
BrowsingContextmodule (navigation, tree, captureScreenshot).Networkmodule (interception, response/redirect events).Scriptmodule (evaluate, callFunction, preload scripts).Sessionmodule (capabilities, status).
geckodriver itself can also speak BiDi to the same server.
CDP compatibility
remote/cdp/ reimplements a subset of Chrome's DevTools Protocol so tools targeting Chrome (Puppeteer, Cypress) can drive Firefox. Coverage is partial; new tools are encouraged to use BiDi instead.
Enabling
--marionette— enable Marionette server.--remote-debugging-port=PORT— CDP / BiDi server.- Prefs:
marionette.enabledremote.active-protocols(e.g.bidi,cdp)
Related
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.