geckordp.firefox module

class geckordp.firefox.Firefox

Bases: object

static get_binary_path() str

Get the path of the firefox binary.

Raises:
  • RuntimeError – If platform is not supported.

  • RuntimeError – If firefox is not found.

Returns:

The path of firefox profiles.

Return type:

Path

static get_profiles_path() Path

Get the path of firefox profiles.

Raises:
  • RuntimeError – If platform is not supported.

  • RuntimeError – If “profiles.ini” is not found.

Returns:

The path of firefox profiles.

Return type:

Path

static start(url: str, port: int, profile: str, append_args: List[str] | None = None, override_firefox_path='', auto_kill=True, wait=True) Popen

Starts a firefox instance.

Note

The profile needs to be once configured with set_required_configs(). To manually start firefox, this command can be used:

firefox -new-instance -no-remote -new-window https://example.com/ -p geckordp –start-debugger-server 6000

Parameters:
  • url (str) – The url for the start page

  • port (int) – The port to use for the rdp server.

  • profile (str) – The profile to use.

  • append_args (List[str], optional) – Additional args for Firefox. Defaults to None.

  • override_firefox_path (str, optional) – Overrides the default firefox binary path.

  • auto_kill (bool, optional) – Enables the termination of firefox if the python process is also terminated.

  • wait (bool, optional) – Waits for the firefox instance to finish loading.

Returns:

The process handle.

Return type:

subprocess.Popen