Vibration
Makes the phone buzz in a pattern.
In one line
Can buzz the phone in a pattern, after you have tapped on the page
Makes the phone buzz in a pattern.
Gives tactile feedback only; it cannot read anything. Sites can annoy people or use it for cues, but it also signals the device is a phone.
What it can and can't do
What the user does: You tap a button or touch the page before it buzzes.
It can
- Buzz your Android phone in a pattern
- Stop a buzz it started
- Give touch feedback in games, timers and alerts
It cannot
- Buzz before you have tapped on the page
- Buzz on iPhone, because Safari does not offer it
- Buzz in current Firefox, which no longer offers it
How it differs between platforms: Android Chrome and Edge allow it. iPhone Safari does not.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 32 | 2014-01-14 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Removed | 129 | 2024-08-06 | Until Firefox 26 included, when the vibration pattern was too long or any of its elements too large, Firefox threw an exception instead of returning <code>false |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Supported | 32 | 2014-01-15 | Beginning in Chrome 55, this is not supported in cross-origin iframes. Beginning in Chrome 60, this method requires a user gesture. Otherwise it returns <code>f |
| Samsung Internet | Supported | 2.0 | 2014-10-17 | Beginning in Chrome 55, this is not supported in cross-origin iframes. Beginning in Chrome 60, this method requires a user gesture. Otherwise it returns <code>f |
How a site asks for it
| API | navigator.vibrate(pattern) |
| Browser compat keys | api.Navigator.vibrate |
| How access is granted | gesture |
| What the user sees | No prompt; needs a prior tap on the page |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | Yes |
| How long it lasts | None |
| How to take it back | Mute device |
| Inside an iframe | Needs user activation in the frame (sticky activation) |
Typical flow
- User taps
- Call navigator.vibrate([200,100,200])
Data you get
Shape: none
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
pattern | list | ms | array of up to 10 durations; each up to 10000 ms | Chrome clamps |
Technical limits
- Needs a prior tap on the page
- Android only in practice; ignored on iOS
- No effect with ringer off on some devices
The story
What it is
A site can make your phone buzz in a pattern after a tap.
For you
A short buzz confirms a tap or warns you about something in the page. Safari on iPhone does not allow it.
For makers
Makers add buzz for touch feedback, alerts and game effects. It works without a prompt but only after you have tapped the page.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A browser shooter buzzes when you are hit, and a racing game buzzes when you bump a car. | None named |
| fitness | A web workout timer buzzes when it is time to switch moves. | None named |
| accessibility | A web app uses short and long buzzes as a code for people who cannot see the screen. | None named |
| delivery | A web ride or food app buzzes when the driver arrives, if the page is open. | None named |
| messaging | A web chat buzzes when a message lands while you are in the app. | None named |
| security | A shady page may buzz to trick you into thinking you got a call or alert. | None named |
Risks
- Annoying buzzes
- Alert tricks
What the platform says
- Mozilla: Vibration API. MDN says the API lets a page use the phone's vibration hardware for touch feedback.
Good uses and abuse
Legitimate uses
- Game feedback
- Timer alerts
Known abuse
- Nuisance buzzing
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 2 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 0.5 | Rough identifying entropy, when known |
History
- 2013, Chrome 32: Vibration API ships
- 2017-01, Chrome 60: Requires user activation
- 2024-09, Firefox 129: Firefox removes Navigator.vibrate
Related capabilities
Related
- Gamepad API and haptics. Can see your game controller after you press a button, and make it rumble
Sources
How well checked: Checked against real behavior.