navigator.maxTouchPoints and 'ontouchstart' in window answer two different questions about the same screen. maxTouchPoints is a count: how many fingers the device can track at once, 0 when there is no touch screen and 10 on a typical touch laptop. ontouchstart is a yes or no: does this browser expose touch events at all. Two CSS media features, pointer and hover, answer a third question, how the person points. On a real machine all of them agree, because they all come from the same hardware.

That agreement is what makes touch a trap for anyone changing a fingerprint. Change one route and leave the others alone and a page does not need a database to catch it. It only has to ask twice.

maxTouchPoints vs ontouchstart: what each one reads

Here are the routes a page has, and what each one costs it to read:

RouteWhat it saysHow a page reads it
navigator.maxTouchPointsnumber of touch pointsone property
'ontouchstart' in windowtouch event API presentone property check
(pointer: coarse), (any-pointer: coarse)primary pointer, and any pointer, is a fingermatchMedia() or CSS
(hover: none), (any-hover: none)the pointer cannot hovermatchMedia() or CSS

Every one of these is free, synchronous and silent. None asks permission, and none shows up as anything unusual in a page's network traffic. A media query does not even need script, because a stylesheet can load a different background image for (pointer: coarse) and the server sees which one was fetched.

The real answers differ by machine, and the combinations are what a page compares:

MachinemaxTouchPointsontouchstartprimary pointeralso available
Desktop or Mac laptop0nofine, can hovernothing else
Windows touch laptop10yesfine, can hovercoarse, no hover
Android phone5 on the phones we capturedyescoarse, no hovernothing else

A touch laptop is the row people get wrong. It has a trackpad and a screen, so its primary pointer is fine and it can hover, while any-pointer: coarse and any-hover: none are also true. Treating it as a big phone is as wrong as treating it as a desktop.

Every profile is drawn from one real computer, not from separate listsIn Mosaic: Machines that exist. GPU, screen, CPU and fonts from one real device. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

How it works: Machines that exist

Spoofing maxTouchPoints alone

Our generator draws a Windows machine with ten touch points 18 per cent of the time. macOS profiles are always 0, and the generator's own audit flags anything else ("macOS desktops report maxTouchPoints = 0"), since Apple does not sell a Mac with a touch screen. An Android profile that reports none is flagged too.

The engine claims the count inside the engine. Our change makes NavigatorEvents::maxTouchPoints return the value of --fingerprint-max-touch-points, and that is all it does. It deliberately leaves the TouchEvent constructor alone. Chromium already ships it on every desktop build, so gating it would create the mismatch the change is meant to prevent.

Now run that ten-point profile on a machine with no touch screen. maxTouchPoints says 10. ontouchstart says no. (any-pointer: coarse) says no. (any-hover: none) says no. One route claims a touch laptop and three describe a desktop, which is a device nobody owns. We found this one by reading Blink for every other caller of the same hardware fact after changing the obvious one, and it was one of five values in the engine with a second route nobody had looked for. The deviceMemory client hint was another (the header that read the real memory).

The fix was two switches Chromium already has

We did not write a second engine change. Chromium has its own switches for both of the other routes, and they move the media-query engine rather than an accessor, which is more coherent than anything we would have added ourselves:

  • --touch-events=enabled or disabled decides whether the touch event API exists, so ontouchstart follows the claim.
  • --blink-settings sets primaryPointerType, availablePointerTypes, primaryHoverType and availableHoverTypes, which are what the pointer, any-pointer, hover and any-hover queries are computed from.

The values are bitmasks: for pointers none is 1, coarse 2 and fine 4; for hover none is 1 and hover 2. A Mosaic profile with no touch points launches with a fine pointer only (4) and hover only (2). A touch laptop profile gets a fine primary pointer with fine and coarse available (6), and hover with both hover and no-hover available (3). An Android profile gets coarse only (2) and no hover (1).

We set them in both directions, and that half is easy to miss. A profile claiming zero touch points on a computer that does have a touch screen would otherwise report a coarse pointer beside a count of 0, the same contradiction the other way round. On a machine that already matches the claim, forcing these values changes nothing.

Before trusting either switch name we checked it with strings against the engine binary, because Chromium accepts a switch it does not know without a word, and a misspelt one looks exactly like a working one.

The phone case, measured

The first live Android profile showed why the phone is its own row. It reported maxTouchPoints 5 and ontouchstart present, and still answered false to (pointer: coarse) and false to (hover: none), because the pointer values were written for the desktop case. Five touch points beside a fine pointer that hovers is not a phone and not a laptop.

A phone has no fine pointer and cannot hover, so its primary and available sets are now coarse and none, and nothing else. The model client hint is another place an Android profile has to agree with itself, and the rest of what a profile is drawn from is in real fingerprints.

How to check your own profile

Paste this into the console of any page and compare it with the table above:

({
  maxTouchPoints: navigator.maxTouchPoints,
  ontouchstart: 'ontouchstart' in window,
  coarse: matchMedia('(pointer: coarse)').matches,
  anyCoarse: matchMedia('(any-pointer: coarse)').matches,
  hoverNone: matchMedia('(hover: none)').matches,
  anyHoverNone: matchMedia('(any-hover: none)').matches
})

If maxTouchPoints is above 0 and anyCoarse is false, or the count is 0 and ontouchstart is true, something changed one route and not the others.