Skip to Content
Platform.Ontology

DOMRect and getClientRects metrics

Measures element boxes at subpixel precision, including text, emoji and ranges.

Used to track youGraphics and fingerprintingLayoutWeb browsersWhen the page loads

In one line

Can measure text and emoji boxes to spot your fonts and system

Measures element boxes at subpixel precision, including text, emoji and ranges.

Sizes of text and emoji boxes depend on installed fonts, text shaping, zoom and OS, giving a hash that works even when canvas is blocked.

What it can and can't do

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

It can

  • Measure the size of hidden text and emoji down to tiny fractions
  • Turn the sizes into a number that depends on your fonts, zoom and system
  • Work even when canvas checks are blocked

It cannot

  • Show you anything on the screen
  • Know your name
  • Ask permission first
  • Give a clear result if the browser adds noise or rounds the sizes

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported22009-05-21None
EdgeSupported122015-07-29None
FirefoxSupported32008-06-17None
SafariSupported42009-06-08None
Safari on iPhoneSupported3.22010-04-03None
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

APIelement.getBoundingClientRect(); getClientRects(); Range.getClientRects()
Browser compat keysapi.Element.getClientRects
api.Element.getBoundingClientRect
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. Insert off-screen elements with odd fonts and emoji
  2. Read rects with float precision
  3. Hash widths and heights

Data you get

What comes back: Floats with up to 10 decimal places per measurement
Shape: hash

FieldTypeUnitRangePrecision
widthfloatCSS px0 to viewportdouble precision

Technical limits

  • Deterministic per font and zoom stack, so entropy is bounded by fonts and DPR

The story

What it is

A script measures the exact size of text and boxes on the page, down to tiny fractions of a pixel.

For you

You see nothing. The page places invisible text, measures it, and the tiny numbers depend on your fonts, zoom and screen. Together they act like a fine detail fingerprint of your setup.

For makers

Layout code needs these numbers all the time, for menus, tooltips, drag and drop and animation. Trackers reuse the same call because tiny rounding differences reveal your system.

Where you see it

TypeExampleApps
productivityA document editor like Google Docs measures text to decide where lines and pages break.Google Docs
creativeA design tool such as Figma measures shapes and text boxes to snap them neatly to each other.Figma
gamesA browser game checks where UI boxes sit so a click lands on the right button.None named
securityA fraud tool measures the same emoji at many sizes and compares to known real devices, to spot an emulator.None named
adsA tracker measures the same text across fonts and adds the result to a device ID.None named
shoppingA product page measures a size chart to show a hover zoom exactly over the right part of the image.None named
accessibilityA screen magnifier extension reads boxes to move focus accurately around a page.None named

Risks

  • Reveals fonts and zoom level
  • Hard to block without breaking layout

What the platform says

Good uses and abuse

Legitimate uses

  • None beyond layout

Known abuse

  • Canvas fallback fingerprint, zoom and DPR detection

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

Sources

How well checked: Based on official documentation.

On this page