Skip to content
All fingerprint checksScreen & display

devicePixelRatio matches matchMedia resolution

Check id dpr-matchmedia

What an ordinary browser yields

matchMedia resolution in dppx falls within ±0.01 of the reported devicePixelRatio (or the feature is unsupported, which reads N/A).

What a detector infers

The check compares window.devicePixelRatio against the layout engine's own answer, querying matchMedia with a min-resolution/max-resolution band in dppx around the reported value. It first feature-detects support for the resolution media feature and reports N/A where the feature is unavailable, and it uses a ±0.01 tolerance band so that legitimate fractional ratios (Windows display scaling, Android densities) are not failed by floating-point round-tripping. Like the screen check, this is a two-source read of one underlying quantity: devicePixelRatio is a JS property, while resolution in dppx is computed by the rendering pipeline. A detector observing a mismatch infers that the ratio was patched at the JS surface while rasterization continued at the true scale — an inconsistency a genuine browser cannot produce, since both trace back to the same device scale factor.

How to resolve it

Leave devicePixelRatio to the real rendering scale. To present a different ratio, set it at launch through the browser's device-scale-factor so the compositor rasterizes at that scale, rather than overriding the property from page script.

What is screen fingerprinting?

Read in the wild by

Kasada

Reads window.devicePixelRatio in both the page realm and a hidden iframe realm it creates itself, and separately binary-searches the CSS resolution media feature in dpi.

probes.txt: window_device_pixel_ratio, iframe_device_pixel_ratio, media_resolution. Page realm: 2.txt:7134 `r5.efg["devicePixelRatio"]`; iframe realm: 2.txt:11769 `r4.lbg["devicePixelRatio"]`, where lbg is bound to the iframe's contentWindow at 2.txt:39630 (`r6 = r5["contentWindow"]; r4["lbg"] = r6;`). The iframe is built at 2.txt:17558-17566: `document.createElement("iframe")`, `style.display = "none"`, `src = "javascript:;"`, `body.appendChild`. Resolution probe at 2.txt:29932 and 3.txt:38313 (two script versions): `r5.call(undefined, "resolution", 0, 512, 1, "dpi")`, via the bound window.matchMedia query builder at 2.txt:14573. Source: ips.js 427-probe teardown (emro.cat, Apr 2026).

CreepJS

CreepJS, an open research demo rather than a production detector, re-asks the layout engine for the reported ratio with an exact `(resolution: <dpr>dppx)` media query and records a mismatch as a lie against Window.devicePixelRatio, skipping the check on WebKit.

src/screen/index.ts:37-53 — `const dpr = window.devicePixelRatio || 0` … `const hasLiedDPR = !matchMedia(`(resolution: ${dpr}dppx)`).matches` … `if (!IS_WEBKIT && hasLiedDPR) { lied = true; documentLie('Window.devicePixelRatio', 'lied dpr') }` (github.com/abrahamjuliot/creepjs, master)

Every attribution traces to a published artifact. See the sources and their limits.

Nearby checks in Screen & display

See all 15 checks in Screen & display
Who builds this test

Clearcote is a browser built for fingerprint coherence

It is a Chromium fork, maintained by the same people who wrote this reference. It ships as a compiled browser rather than as a stealth script injected into someone else's — which is a description of how it is built, and is not an argument about how it behaves on this check.

This audit takes no position on how Clearcote scores on Screen & display checks, on this one, or anywhere else. It has no baseline corpus of other people's fingerprints to rank you against and no vendor scoreboard — nearly every check is self-referential, asking one browser the same question through two independent APIs and reporting whether both answers can be true at once. It runs identically on any browser, including ours. Run it on yours and read the result yourself.

See the other checks in Screen & display — the family dpr-matchmedia belongs to.