The Vibration API is an API specifically made for mobile devices as they are thankfully the only devices that have a vibrate function.
However, this doesn’t mean that your device can vibrate. Just that it’s recent enough. There are a few requirements you need to meet.
- You need the hardware for it.
- The page needs to be visible.
- Browser-specific implementation prevents the vibration.