What media queries expose
matchMedia() answers yes/no to environment questions that come from the OS and the device:
prefers-color-scheme- light or dark, set by the OS theme.prefers-reduced-motionandprefers-reduced-transparency- accessibility settings.prefers-contrastandforced-colors- high-contrast / Windows high-contrast mode.pointerandany-pointer-fine(mouse/stylus) vscoarse(finger).hoverandany-hover- whether the primary input can hover.- display metrics - resolution, aspect ratio, orientation.
Each answer is one bit or a small set of choices, so any single feature reveals little (its entropy - how much it narrows down the device - is low). The real value is in the combination, and in whether it stays consistent with the rest of the device's story.
The coherence and uniformity tells
This catches scrapers in two ways. First, device coherence - the values have to agree with the device the browser claims to be. A request with an Android or iPhone User-Agent (the browser/device string sent with each request) must report pointer: coarse and hover: none, because phones have no fine pointer and cannot hover. A "phone" that reports pointer: fine and hover: hover is really a desktop headless browser wearing a mobile UA. Likewise a touch tablet and a mouse-driven desktop have different pointer/hover signatures, and these must match the claimed device and the touch/hardware signals.
Second, fleet uniformity - bots tend to look identical to each other. Headless browsers default to a light color scheme, no reduced motion, a fine pointer, and hover enabled. Real human traffic is a mix: a meaningful fraction use dark mode, some enable reduced motion, mobile users report coarse pointers. A population of visitors that all report the same headless-default media profile stands out against that natural spread. Anti-bot systems look at the distribution across many visitors, not just the values from one.
