bug: Hardcoded user-agent strings are inconsistent and will become outdated #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: #3
Description
Multiple places hardcode user-agent strings with different Firefox versions:
playwright.go:94—Firefox/142.0interactive.go:62—Firefox/142.0cmd/browser/pkg/browser/flags.go:20—Firefox/133.0(older!)The flags.go default text is already outdated compared to the main library. These will all become stale over time and could trigger bot detection.
Fix
Options:
const DefaultUserAgentin the extractor package and reference it everywheresites/useragentspackage to dynamically fetch the current most common user-agent on startup (more robust but adds a network dependency)Starting work on this. Will define
const DefaultUserAgentin a central location and reference it from all three locations.Work finished. PR: #39 (merged)
Defined
DefaultUserAgentconstant (Firefox/147.0) and replaced all three inline UA strings.