Skip to content

Respect user's preferred browser #897

Description

@Sharparam

Problem Description

Pdoc uses a hardcoded priority list for which browser to launch, ignoring the user's preference if set in the BROWSER environment variable or similar.

Proposal

Pdoc should launch the browser specified by $BROWSER, if set, or use something like xdg-open (which will take $BROWSER into account).

Alternatives

Place Firefox higher up in the priority, users with Firefox installed are more likely to actively prefer it over other browsers. Users preferring Chrom(e|ium) are less likely to have Firefox installed (probably).

Additional context

Hardcoded list here: https://github.com/mitmproxy/pdoc/blob/main/pdoc/web.py#L173-L186

Reproduction steps

export BROWSER=firefox
pdoc <module>
# Expect docs to open in already running firefox, pdoc instead spawns a chromium process if it is installed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions