Skip to main content

Module browser

Module browser 

Source
Expand description

Opening a URL in the user’s default browser.

The launcher differs per OS (open, xdg-open, cmd /c start). The platform selection is a pure function tested against every OS string, and the actual process spawn is injected, so nothing here needs a #[cfg] and every branch is reachable under test on a single platform.

Functions§

open_command_for
The launcher command and arguments for url on os.
open_url
Open url in the default browser.
open_url_via
Open url in the default browser, spawning via spawn.
spawn_detached
Spawn cmd fire-and-forget, discarding its output.