fix: consolidate user-agent strings into DefaultUserAgent constant
All checks were successful
CI / build (pull_request) Successful in 44s
CI / test (pull_request) Successful in 46s
CI / vet (pull_request) Successful in 1m28s

Define DefaultUserAgent (Firefox/147.0) in playwright.go and reference
it from NewBrowser, NewInteractiveBrowser, and CLI flags. Previously
three different UA strings existed (two at 142.0, one outdated at 133.0).

Closes #17

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 16:24:44 +00:00
parent 0df639abea
commit 097b2e12c7
3 changed files with 7 additions and 4 deletions

View File

@@ -59,7 +59,7 @@ type interactiveBrowser struct {
func NewInteractiveBrowser(ctx context.Context, opts ...BrowserOptions) (InteractiveBrowser, error) {
var thirtySeconds = 30 * time.Second
opt := mergeOptions(BrowserOptions{
UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0",
UserAgent: DefaultUserAgent,
Browser: BrowserFirefox,
Timeout: &thirtySeconds,
Dimensions: Size{