Add per-engine UA constants (DefaultFirefoxUserAgent, DefaultChromiumUserAgent) with DefaultUserAgent kept as backward-compatible alias
initBrowser now auto-selects the matching UA based on opt.Browser when the caller hasn't explicitly set one — fixes Firefox UA being applied to Chromium instances
Add 1920x1080 default viewport to NewBrowser (previously had none — a strong headless signal)
NewInteractiveBrowser also gains engine-aware UA selection (keeps its existing 1280x720 viewport)
Tests cover UA constant content, backward-compat alias, and mergeOptions viewport/UA behavior
## Summary
- Add per-engine UA constants (`DefaultFirefoxUserAgent`, `DefaultChromiumUserAgent`) with `DefaultUserAgent` kept as backward-compatible alias
- `initBrowser` now auto-selects the matching UA based on `opt.Browser` when the caller hasn't explicitly set one — fixes Firefox UA being applied to Chromium instances
- Add 1920x1080 default viewport to `NewBrowser` (previously had none — a strong headless signal)
- `NewInteractiveBrowser` also gains engine-aware UA selection (keeps its existing 1280x720 viewport)
- Tests cover UA constant content, backward-compat alias, and mergeOptions viewport/UA behavior
Closes #70
Relates to #68
## Test plan
- [x] `go build ./...` succeeds
- [x] `go test ./...` all pass (including 8 new tests)
- [x] `go vet ./...` clean
- [ ] Verify `cmd/browser/pkg/browser/flags.go` still compiles with `DefaultUserAgent` alias
🤖 Generated with [Claude Code](https://claude.com/claude-code)
NewBrowser previously had no viewport (strong headless signal) and used a
Firefox User-Agent unconditionally, even for Chromium instances (detectable
mismatch).
Add per-engine UA constants (DefaultFirefoxUserAgent, DefaultChromiumUserAgent)
and auto-select the matching UA in initBrowser when the caller hasn't set one
explicitly. Keep DefaultUserAgent as a backward-compatible alias.
Add 1920x1080 default viewport to NewBrowser (most common desktop resolution).
NewInteractiveBrowser keeps its existing 1280x720 default but also gains
engine-aware UA selection.
Closes#70
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
DefaultFirefoxUserAgent,DefaultChromiumUserAgent) withDefaultUserAgentkept as backward-compatible aliasinitBrowsernow auto-selects the matching UA based onopt.Browserwhen the caller hasn't explicitly set one — fixes Firefox UA being applied to Chromium instancesNewBrowser(previously had none — a strong headless signal)NewInteractiveBrowseralso gains engine-aware UA selection (keeps its existing 1280x720 viewport)Closes #70
Relates to #68
Test plan
go build ./...succeedsgo test ./...all pass (including 8 new tests)go vet ./...cleancmd/browser/pkg/browser/flags.gostill compiles withDefaultUserAgentalias🤖 Generated with Claude Code