Closed Bug 1900037 Opened 6 months ago Closed 5 months ago

Disable broken vibration APIs

Categories

(Core :: DOM: Core & HTML, task)

task

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: saschanaz, Assigned: saschanaz)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

Currently our navigator.vibrate() and Notification.vibrate is being fully ignored, while we are still exposing the API. This is bad for feature detection and we should not expose non-working API.

Keywords: dev-doc-needed
Summary: Unship broken vibration APIs → Disable broken vibration APIs

Chrome use counter of navigator.vibrate() shows somewhere between 0.06 and 0.08%: https://chromestatus.com/metrics/feature/timeline/popularity/850

Quick check on the sampled list of most popular websites shows feature detection:

  • navigator.vibrate && navigator.vibrate()
  • (_18 = 'vibrate' in navigator && navigator.vibrate);
  •   navigator.vibrate = navigator.vibrate ||
      navigator.webkitVibrate ||
      navigator.mozVibrate ||
      navigator.msVibrate;
      if (navigator.vibrate) {
        navigator.vibrate([500])
      }
    
  •                     (
                          navigator.vibrate ? navigator.vibrate(500) : navigator.webkitVibrate &&
                          navigator.webkitVibrate(500)
                        );
    

GitHub code search also shows frequent feature detection: https://github.com/search?q=navigator.vibrate+language%3AJavaScript&type=code&l=JavaScript

FWIW, it was removed from WebKit on 2017-05-05:
https://bugs.webkit.org/show_bug.cgi?id=171766

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch

FF129 MDN docs work for this tracked in https://github.com/mdn/content/issues/34703 (essentially a compatibility data update and a release note).

Regressions: 1924685
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: