NewContext() and AsyncNewContext() passed ff_version=None through to
generate_context_fingerprint(), so a context's user agent kept the version
fpgen drew (e.g. Firefox/146) while the browser underneath was 152. They
now default ff_version to the major version of Playwright's
Browser.version, which Juggler reports from MOZ_APP_VERSION_DISPLAY, so the
UA always names the browser the page is actually talking to. An explicit
ff_version still wins.
The docstrings said each context gets "its own real fingerprint preset";
the default has been an fpgen draw, with a preset only when one is passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NewContext derives the context's WebRTC IP and timezone from the proxy's exit
IP. That lookup had two defects, and both left the context showing the
host's values while its traffic went through the proxy:
- It built its own proxy URL with urlparse, which reads a scheme-less server
such as "1.2.3.4:8080" (a form Playwright accepts) as scheme "1.2.3.4" with
no host. urllib could not use a SOCKS proxy at all.
- Any failure was swallowed, and the context opened without the values.
The URL is now built with Proxy.as_string(), which the geoip launch path
already uses (scheme-less means http). The lookup goes through requests,
which handles SOCKS, and a failed lookup raises InvalidIP, naming the two
options that skip it. The tests cover scheme-less, http and socks5 servers
with credentials, both failure modes, and the case where no lookup is needed,
for NewContext and AsyncNewContext.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>