Touch events and touch point count
Reports finger positions and the number of touch points the device supports.
In one line
Can see your finger touches and how many touch points your device supports
Reports finger positions and the number of touch points the device supports.
navigator.maxTouchPoints separates phones, tablets and touch laptops from plain desktops, a common fingerprint input. Touch radius and force add small device level detail.
What it can and can't do
What the user does: Nothing. It happens when you touch the screen, and the touch count is checked on load
It can
- See where and when your fingers touch the page
- Tell a phone, tablet or touch laptop apart from a plain desktop
- Learn small details like touch size where supported
It cannot
- See touches on other pages or apps
- See touches while the page is in the background
- Work in desktop Safari, which does not have touch events
How it differs between platforms: Chrome, Firefox and Safari on iPhone support them. Safari on Mac does not.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 22 | 2012-09-25 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Supported | 52 | 2017-03-07 | None |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Supported | 3.2 | 2010-04-03 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 25 | 2013-02-27 | None |
| Samsung Internet | Supported | 1.5 | 2013-09-25 | None |
How a site asks for it
| API | touchstart/move/end; Touch.radiusX, radiusY, force; navigator.maxTouchPoints; 'ontouchstart' in window |
| Browser compat keys | api.TouchEventapi.Touchapi.Navigator.maxTouchPoints |
| How access is granted | none |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| Activation | none |
| How long it lasts | While touching |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | Events go to the touched frame |
Typical flow
- Person touches the screen
- touchstart and touchmove fire
- Page reads clientX, clientY, radiusX and force
Data you get
Shape: none
No individual data fields. The signal is the access itself.
Technical limits
- maxTouchPoints is 0 on no touch hardware, commonly 5 on phones, 10 on tablets and laptops (up to 20 on some)
- TouchEvent constructors exist only on touch capable devices in Chromium; Safari desktop has no TouchEvent
- force is 0 to 1 where hardware supports it; radius may be 0 on devices that do not report contact area
- touchstart and touchmove listeners on window default to passive in Chrome 56 and Safari 11.1 (cannot cancel scroll)
- Cannot read touches outside the page or on the browser UI
The story
What it is
The page sees finger touches and how many touch points your device supports.
For you
You tap, swipe and pinch and the page responds. You do not see that the site also learned how many fingers your device can track. That number helps it tell a phone from a laptop.
For makers
Touch drives mobile games, maps and drawing. The touch point count also helps sites guess device type and block fake browsers, so it shows up in fingerprints.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A mobile browser game turns finger drags into movement and taps into actions, with several fingers at once. | Wordle (NYT), 2048 |
| games | A cloud gaming site draws on screen controller buttons for touch players. | Xbox Cloud Gaming, GeForce NOW |
| maps | A web map lets you pinch to zoom and two finger rotate. | Google Maps |
| creative | A drawing app supports multitouch gestures for zoom and undo. | Figma, Procreate-style web apps |
| analytics | A site checks touch points to split phone, tablet and desktop traffic. | Google Analytics |
| security | A fraud check flags a browser that claims to be a phone but reports zero touch points. | None named |
Risks
- Helps identify device type
- Part of a fingerprint
What the platform says
- MDN (standards docs): Touch events. Describes events for touch screens that tell pages when and where fingers touch, move and lift.
Good uses and abuse
Legitimate uses
- Gestures
- Mobile games
- Draw and sign pads
Known abuse
- Touch device detection in fingerprints
- Touch heat maps
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 1 | Rough identifying entropy, when known |
History
- 2017-01, Chrome 56: Document level touch listeners passive by default
- 2018-03, Safari 11.1: Passive touch listeners default
Related capabilities
Related
- Pointer events (mouse, pen, touch detail). Can see where your mouse, finger or pen is and how it moves on the page
Sources
How well checked: Based on official documentation.