Skip to content

selenium.browser.firefox

Firefox capabilities and the moz:firefoxOptions vendor object.

Firefox

class Firefox: selenium.browser.Browser;

A Firefox browser with its moz:firefoxOptions capabilities.

The options object is a Mozilla vendor extension, not part of W3C. The standard capabilities still come from Browser. Geckodriver only supports one active session, so Firefox bridges have a forced capacity of one.

Preferences

struct Preferences;

Wrapper struct for preferences. Firefox only supports user preferences. Preferences are NOT sanitized or validated, and are expected to be JSON objects. Preferences can be found at https://searchfox.org/firefox-main/source/modules/libpref/init/all.js

user

JSONValue user;

User profile preferences.

release

string release;

Filter for matching a specific browser version.

binary

string binary;

Browser binary. To set a custom binary (ie: Librewolf), set this to the path of the binary.

args

string[] args;

Arguments to be appended when launching.

prefs

Preferences prefs;

Preferences. These are client preferences for the active profile.

profile

string profile;

This is universal for both the recommended --profile and the legacy firefox_profile. Must be either a directory path or base-64 archive.

logLevel

LogLevel logLevel;

Driver log verbosity, serialized as moz:firefoxOptions.log.level. Defaults to LogLevel.off, which omits the field.

name

string name() const;

The browserName capability.

driverCapacity

int driverCapacity() const;

Restricts each geckodriver bridge to its single supported session.

toJSON

JSONValue toJSON() const;

Serializes the standard capabilities plus moz:firefoxOptions.

parseFrom

protected void parseFrom(JSONValue json);

Populates the standard capabilities and moz:firefoxOptions fields.