simonw / shot-scraper

A command-line utility for taking automated screenshots of websites
https://shot-scraper.datasette.io
Apache License 2.0
1.57k stars 70 forks source link

Add browser arguments option #138

Closed nielthiart closed 5 months ago

nielthiart commented 6 months ago

Ref https://github.com/simonw/shot-scraper/issues/137

This change adds --browser-args option to the CLI, then passes a list of arguments to the browser launch function.

The argument can be included multiple times to list multiple arguments.

This enables users to pass flags to the browser, such as --font-render-hinting=none, --disable-gpu, etc.

These flags can have an effect on how screenshots are captured across different platforms.

Detailed reason here: https://github.com/simonw/shot-scraper/issues/137


📚 Documentation preview 📚: https://shot-scraper--138.org.readthedocs.build/en/138/

simonw commented 5 months ago

This is a neat change. I'm going to merge as-is, but I'm not a fan of capitalized short options so I'll remove the -B and keep it as just --browser-args.

I'll also rename --browser-args to just --browser-arg for consistency with my other tools.