How can I find out if a device has a vibrator?

Viewed 8049

I have a device of which I don't know if it has a vibrator.

Is there a way to query for the availability of the vibrator?

4 Answers

Maybe it'll help someone. Since I'm building a PWA, I ended up checking the screen size:

  if (window.innerWidth < 600) {
    window.navigator.vibrate(300);
  }
Related