Skip to Content
Platform.Ontology

CSS feature and media query probing

Tests which CSS properties, at-rules and media queries the browser understands.

Used to track youGraphics and fingerprintingCSSWeb browsersWhen the page loads

In one line

Can find your browser version by testing which style features it knows

Tests which CSS properties, at-rules and media queries the browser understands.

Each CSS feature has a first-supported version, so a handful of CSS.supports calls pin the browser version within 1 to 2 releases and expose spoofed user agents. Media queries add color gamut, HDR, contrast and motion settings.

What it can and can't do

What the user does: Nothing. It happens when the page loads

It can

  • Test which CSS features and media queries your browser supports
  • Narrow your browser version to within about 1 to 2 releases
  • Spot a fake browser label, such as a spoofed user agent

It cannot

  • Know who you are by itself
  • Ask permission first
  • See anything you typed or saved
  • Tell your exact device model

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported282013-07-09None
EdgeSupported122015-07-29None
FirefoxSupported222013-06-25None
SafariSupported92015-09-30None
Safari on iPhoneSupported92015-09-16None
Chrome on AndroidSupported282013-07-10None
Samsung InternetSupported1.52013-09-25None

How a site asks for it

APICSS.supports(); @supports; matchMedia(); getComputedStyle()
Browser compat keysapi.CSS.supports_static
api.Window.matchMedia
How access is grantednone
What the user seesNot listed
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Run CSS.supports for 50 to 300 property:value pairs
  2. Query matchMedia for color-gamut, dynamic-range, prefers-contrast, forced-colors, pointer, hover
  3. Compare against per-version tables

Data you get

What comes back: Bit vector of 100 to 300 feature results plus about 15 media query values
Shape: list

FieldTypeUnitRangePrecision
supports bitslistNone0 or 1 eachexact
color-gamutenumNonesrgb, p3, rec2020exact
prefers-reduced-motionenumNoneno-preference, reduceexact
forced-colorsenumNonenone, activeexact

Technical limits

  • Cannot read the stylesheet of other origins
  • Entropy mostly browser version and accessibility settings

The story

What it is

A script checks which CSS features and screen settings your browser understands to guess its make and version.

For you

You never see it. It looks like normal page loading. The page asks your browser many yes or no questions about style features, and the pattern of answers shows what browser and version you have.

For makers

Sites use it to ship modern designs with a safe fallback. Trackers use the same answers to pin your exact browser version and spot fake ones, such as a bot pretending to be Chrome.

Where you see it

TypeExampleApps
developerA website checks whether your browser supports grid layout, then uses it or falls back to a simpler layout.None named
securityA bot detector notices a browser claiming to be Chrome 120 that fails a test only new Chrome passes.Cloudflare Turnstile, DataDome
analyticsA fingerprint library records dozens of CSS answers as one part of a visitor ID.FingerprintJS
mediaA streaming site checks for modern color and HDR display settings to offer the best video.Netflix
accessibilityA page checks whether you prefer dark mode, reduced motion or high contrast and adjusts itself.None named
gamesA browser game checks for features like high frame rate or wide color before switching on fancy visuals.None named
adsAn ad tech script uses screen and color settings to separate an iPhone from a lookalike emulator.None named

Risks

  • Hard to hide
  • Lets sites spot fake browsers

What the platform says

  • MDN: CSS @supports. Lets a page test whether the browser supports a CSS feature, and apply styles only if it does.

Good uses and abuse

Legitimate uses

  • Progressive enhancement

Known abuse

  • Version pinning, UA spoof detection, accessibility setting disclosure

Scores

ScoreValueMeaning
Sensitivity3 of 5How revealing the data is
Utility1 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits4Rough identifying entropy, when known

History

  • 2018-05, paper: FP-Stalker and CreepJS use CSS feature sets to track version evolution

Sources

How well checked: Based on official documentation.

On this page