hover, pointer, any-pointer
Whether the main input is a mouse, finger or stylus and whether hover works.
In one line
Can tell if you use a mouse, finger or stylus, and whether hover works
Whether the main input is a mouse, finger or stylus and whether hover works.
pointer is coarse for touch, fine for mouse or pen; hover is hover or none. any-* variants say if any attached device qualifies, revealing a mouse on a tablet or a touchscreen on a laptop.
What it can and can't do
What the user does: Nothing. It happens when the page loads.
It can
- Check what your main input is
- Check which other inputs are attached, at a rough level
- Make buttons bigger for fingers
It cannot
- See which mouse brand or model you use
- See your clicks or movements
- Tell when you plug in a device later without checking again
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 41 | 2015-03-03 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 64 | 2018-12-11 | None |
| Safari | Supported | 9 | 2015-09-30 | None |
| Safari on iPhone | Supported | 9 | 2015-09-16 | None |
| Chrome on Android | Supported | 50 | 2016-04-13 | None |
| Samsung Internet | Supported | 5.0 | 2016-12-15 | None |
How a site asks for it
| API | matchMedia('(pointer: fine)'), (hover: hover), (any-pointer: coarse), (any-hover) |
| Browser compat keys | css.at-rules.media.pointercss.at-rules.media.hover |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | read fresh on every page load; nothing stored |
| How to take it back | none needed (no grant) |
| Inside an iframe | Readable from cross-origin iframes too (same values) |
Typical flow
- Page script reads the value
- No prompt is shown
Data you get
Shape: object
How often: static per session
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
pointer, any-pointer | enum | None | none, coarse, fine | Not listed |
hover, any-hover | enum | None | none, hover | Not listed |
Technical limits
- Cannot see which device is currently used
The story
What it is
Tells a page whether the main input is a mouse, finger or pen, and whether hover works.
For you
You never see the check. It is why buttons are bigger on a touch screen, and menus open on hover with a mouse but need a tap on a phone.
For makers
Makers use it to give touch users larger buttons and mouse users hover tools. It is also a clue that tells phones from laptops, and helps catch fake devices.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A browser game shows on screen touch controls on a phone and keyboard hints on a laptop. | None named |
| creative | A drawing app turns on pressure and pen tools when a stylus is detected. | Figma, Miro |
| shopping | A store shows a zoom on hover for mouse users and a tap to zoom for phone users. | None named |
| ads | A site chooses a bigger, easier to tap ad close button on touch screens. | None named |
| security | A bot check sees a device that claims to be a phone but supports hover and a fine pointer, which is odd, and adds risk. | None named |
| accessibility | A site makes tap targets larger for people who use coarse input or have shaky hands. | None named |
| travel | A booking site shows hover tips about fees with a mouse and tap to expand on a phone. | None named |
Risks
- Fingerprint clue
- Reveals touch or mouse use
What the platform says
- MDN: pointer and hover media features. Document how a page can detect if the main input is precise like a mouse or coarse like a finger.
Good uses and abuse
Legitimate uses
- Touch-sized targets
Known abuse
- Hardware combination
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 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.5 | Rough identifying entropy, when known |
Related capabilities
Related
- Touch support. Can tell if your screen takes touch and how many fingers at once
Sources
How well checked: Based on official documentation.