Repository navigation
feat(stealth): WebGL in headed mode and a timezone request field - #92
Merged
Merged
Conversation
Xvfb has no GL, so headed Chromium exposed no WebGL context at all; a hard tell on a desktop Chrome UA. --use-angle=swiftshader with --enable-unsafe-swiftshader gives headed mode the same software renderer headless already reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Browser scrapes always reported UTC, which matches no ordinary user and contradicts any non-UTC exit IP. An optional IANA timezone (validated against the tz database; 422 otherwise) falls back to SCRAPE_DEFAULT_TIMEZONE and is applied per tab via Emulation.setTimezoneOverride in configure_driver, after warm adoption. Pages and workers both see it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gildesmarais
force-pushed
the
stealth/webgl-timezone
branch
from
November 30, 2026 17:15
4714793 to
439704d
Compare
gildesmarais
enabled stacked auto-merge (squash)
November 30, 2026 17:16
gildesmarais
added a commit
to html2rss/html2rss
that referenced
this pull request
Nov 30, 2026
## What changed - `request.botasaurus.timezone`, an IANA id such as `Europe/Berlin`, is a new accepted option. It is forwarded on `POST /scrape` through `BotasaurusContract::REQUEST_OPTION_KEYS`. `Config::Validator` accepts it as a non-empty string. - `spec/fixtures/botasaurus/openapi.yaml` is vendored from html2rss/botasaurus-scrape-api#92. `schema/html2rss-config.schema.json` is regenerated. - The six boolean Botasaurus options are declared in one loop, so the schema block stays within `Metrics/BlockLength`. The exported schema is unchanged by this. ## Why The scrape API now lets the caller set the timezone the browser reports to pages, for example to match a residential proxy's exit country (#92). Without the key here, feed configs could not set it. ## Risk - Low. The scrape API owns the IANA check and answers unknown ids with `422`, so the gem does not duplicate the tz database. - Merge order: 1. html2rss/botasaurus-scrape-api#91, then #92 2. #723 3. this PR, retargeted to `master` Review map: small. Start at `spec/lib/html2rss/request_service/botasaurus_contract_spec.rb`. ## Validation - `make ready`: 8717 examples and 0 failures, RuboCop clean, the schema check passes. The sibling-OpenAPI sync spec ran against #92's `openapi.yaml`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
--use-angle=swiftshader --enable-unsafe-swiftshader(RENDER_ARGUMENTSinapp/engine/warm_pool.py). Headed mode runs on Xvfb, the default virtual display, which has no GL, so pages got no WebGL context at all. Now both modes report the same software renderer headless already used:ANGLE (Google, Vulkan … SwiftShader driver).timezonefield onPOST /scrape. It takes an IANA id such asEurope/Berlin, validated against the tz database; unknown ids return422.SCRAPE_DEFAULT_TIMEZONEenv fills it when a request sends none. An invalid value fails at startup.configure_driverapplies it per tab withEmulation.setTimezoneOverride, so it also covers adopted warm spares.openapi.yamlis regenerated. The change is additive andinfo.versionstays at 2.0.0. The README documents the field, the env and the WebGL behavior.Why
These come from a stealth audit of the browser tier:
Risk
create_driver_from_fingerprint. Merge feat(security): enforce SSRF policy inside Chromium with pinned-DNS egress guard #91 first, then retarget this PR tomain.timezoneinBotasaurusContract::REQUEST_OPTION_KEYSand its validator, plus the vendoredopenapi.yaml, before feeds can set it.Review map: small. Start at
tests/engine/test_driver_profile.py(WebGL flags, timezone default and override), thentests/api/test_request_schema.py,app/engine/strategies.py,app/config.py.Validation
make check: 263 tests, pyright 0 errors, openapi-verify ok.make smoke: both profiles pass.create_driver_from_fingerprintandconfigure_driver, in headed mode:nullto the SwiftShader renderer.timezone=Asia/Tokyo, the page and a worker both reportAsia/Tokyo(offset -540). Without it, they report UTC.🤖 Generated with Claude Code