ddp_utils.browser.backends.native.launcher

import ddp_utils.browser.backends.native.launcher

Process launcher for native system browsers.

class ddp_utils.browser.backends.native.launcher.NativeBrowserLauncher

Bases: object

Create owned browser processes from validated native configuration.

Examples

Launch a discovered system browser:

process, info = NativeBrowserLauncher().launch(config, installation)
launch(config: BrowserConfig, installation: NativeBrowserInstallation) → tuple[Popen[Any], NativeProcessInfo]

Launch a browser and return its owned process plus immutable metadata.

Parameters

Name

Type

Description

config

BrowserConfig

Validated native browser configuration.

installation

NativeBrowserInstallation

Resolved executable information.

Returns

Type

Description

tuple[Popen[Any], NativeProcessInfo]

Owned Popen instance and immutable process metadata.

Raises

Exception

Description

BrowserConfigurationError

Native options have invalid types.

BrowserStartupError

The operating system rejects the process launch.

Examples

Preserve the returned process for exact lifecycle ownership:

process, info = launcher.launch(config, installation)
build_command(config: BrowserConfig, installation: NativeBrowserInstallation) → list[str]

Build the exact operating-system argument vector.

Parameters

Name

Type

Description

config

BrowserConfig

Validated native browser configuration.

installation

NativeBrowserInstallation

Resolved executable information.

Returns

Type

Description

list[str]

Command list suitable for subprocess.Popen.

Raises

Exception

Description

BrowserConfigurationError

args or url has an invalid type.

Examples

Inspect a command without starting the browser:

command = launcher.build_command(config, installation)