Respect user's preferred browser
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 228
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pdoc/web.py at lines 173-186, where the hardcoded browser priority list is defined. Reproduce the issue with BROWSER=firefox and pdoc ; done means pdoc respects the requested browser or uses xdg-open so the user's preference is honored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100