fix(fingerprints): enforce the user agent allow list so screen constraints are respected - #2110
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2110 +/- ##
==========================================
- Coverage 93.55% 93.53% -0.02%
==========================================
Files 181 181
Lines 12590 12615 +25
==========================================
+ Hits 11779 11800 +21
- Misses 811 815 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
marked this pull request as ready for review
August 3, 2026 09:07
Mantisus
approved these changes
Aug 3, 2026
janbuchar
approved these changes
Aug 3, 2026
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.
ScreenOptionswere not respected - withstrict=Truefingerprint generation failed, otherwise the screenconstraints were silently dropped and the fingerprint got a screen outside of the requested range.
browserforgeturns the screen constraints into an allow list of user agents and passes it to the headergenerator, but the generator only derives browser, operating system and device from it and then samples the
user agent freely - so the result is often outside the list, and the fingerprint network finds no consistent
sample.
apify-fingerprint-datapoints0.14.0 made that deterministic for some inputs, hence the cap in #2107.PatchedHeaderGeneratornow enforces the allow list: a user agent outside it pins the next attempt to anallowed one with the same browser, operating system and device. If nothing is interchangeable or the attempts
run out, the wider header is returned, so inputs that worked before keep working.
Measured on 0.14.0, before -> after:
strictFirefox + Windows, screen600-1800 x 400-1200300-600 x 500-1200Also drops the
apify-fingerprint-datapoints<0.14.0caps from #2107.test_fingerprint_generator_respects_screen_options_without_strictcovers the non-strict path; it andtest_fingerprint_generator_all_optionsfail onmasterwith the 0.14.0 datapoints.Closes: #2108
✍️ Drafted by Claude Code