Spoof navigator.maxTouchPoints from config - #697
Draft
nxbdev wants to merge 1 commit into
Draft
Conversation
navigator.maxTouchPoints was already a recognized config property (settings/properties.json declares it) but nothing read it, so it always reported 0 on a desktop build regardless of the config. Under a Firefox-for-Android user agent that 0 is a mobile-detection tell: a real phone reports 5, and Firefox's RFP path only ever collapses the value to 0 (MaxTouchPointsCollapse) — there is no path to a phone value without an explicit override. Add the standard MaskConfig early-return at the top of Navigator::MaxTouchPoints, matching how other navigator/screen properties are spoofed. Navigator.cpp already includes MaskConfig.hpp via navigator-spoofing.patch, so no extra include or schema change is needed. Build-verified: applies cleanly against firefox-152.0.4 and compiles for linux/arm64. Tested on the built binary — config value 5 -> 5, 1 -> 1, no config -> 0 (unchanged desktop default). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Related Issue
Closes #696
Description
navigator.maxTouchPointswas already a recognized config property (settings/properties.jsondeclares it) but nothing read it, so it always reported0on a desktop build regardless of the config. Under a Firefox-for-Android user agent that0is a mobile-detection tell — a real phone reports5, and Firefox's RFP path only ever collapses the value to0(MaxTouchPointsCollapse), with no path to a phone value without an explicit override.This adds the standard
MaskConfigearly-return at the top ofNavigator::MaxTouchPoints, matching how every other navigator/screen property is spoofed (GetPlatform,GetOscpu,HardwareConcurrency,nsScreen::PixelDepth, …):Navigator.cppalready includesMaskConfig.hppvianavigator-spoofing.patch, so no extra include is needed and no schema change is required. With this,navigator.maxTouchPointsin the config is honoured (e.g.5for a phone).Type of Change
Testing
Built and driven against the raw binary (same mechanism as
build-tester/runner.py:firefox.launch(executable_path=…, env={CAMOU_CONFIG})), readingnavigator.maxTouchPointson a page:CAMOU_CONFIG0(unchanged desktop default){"navigator.maxTouchPoints": 5}5{"navigator.maxTouchPoints": 1}1main(Firefox152.0.4,beta.28) —patching file dom/base/Navigator.cpp, no rejects/fuzz.linux/arm64build.Fingerprint Report
Fingerprint report
build-tester score/screenshot to be attached once the current beta.28 arm64 build completes — this PR is opened as a draft until then.
Checklist
Service tests pass(nopythonlib/changes)