Skip to content

Spoof navigator.maxTouchPoints from config - #697

Draft
nxbdev wants to merge 1 commit into
daijro:mainfrom
nxbdev:feat/mobile-maxtouchpoints-spoofing
Draft

Spoof navigator.maxTouchPoints from config#697
nxbdev wants to merge 1 commit into
daijro:mainfrom
nxbdev:feat/mobile-maxtouchpoints-spoofing

Conversation

@nxbdev

@nxbdev nxbdev commented Jul 22, 2026

Copy link
Copy Markdown

Related Issue

Closes #696

Description

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), with no path to a phone value without an explicit override.

This adds the standard MaskConfig early-return at the top of Navigator::MaxTouchPoints, matching how every other navigator/screen property is spoofed (GetPlatform, GetOscpu, HardwareConcurrency, nsScreen::PixelDepth, …):

if (auto value = MaskConfig::GetUint32("navigator.maxTouchPoints")) {
  return value.value();
}

Navigator.cpp already includes MaskConfig.hpp via navigator-spoofing.patch, so no extra include is needed and no schema change is required. With this, navigator.maxTouchPoints in the config is honoured (e.g. 5 for a phone).

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Other

Testing

Built and driven against the raw binary (same mechanism as build-tester/runner.py: firefox.launch(executable_path=…, env={CAMOU_CONFIG})), reading navigator.maxTouchPoints on a page:

Case CAMOU_CONFIG Result
Control (no config) 0 (unchanged desktop default)
Phone value {"navigator.maxTouchPoints": 5} 5
Single-touch {"navigator.maxTouchPoints": 1} 1
  • Patch applies cleanly against the current main (Firefox 152.0.4, beta.28) — patching file dom/base/Navigator.cpp, no rejects/fuzz.
  • Verified on a linux/arm64 build.

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

  • I have linked a related issue above
  • My changes are focused on a single logical change
  • I have added testing instructions which include the desired result
  • Service tests pass (no pythonlib/ changes)
  • Build test passes (score ≥ 1000, screenshot) — pending, will attach before marking ready

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>
@JWriter20 JWriter20 mentioned this pull request Jul 30, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spoof navigator.maxTouchPoints from config

1 participant