Closed Bug 1591113 Opened 4 years ago Closed 4 years ago

Remove support for third-party vibrate


(Core :: DOM: Device Interfaces, defect)

Not set



Tracking Status
firefox72 --- fixed


(Reporter: annevk, Assigned: tnguyen)


(Regressed 1 open bug, )


(Keywords: dev-doc-complete, site-compat)


(1 file)

navigator.vibrate() is supported on Android and has its own permission dialog. For bug 1572461 we would either need to support delegating this permission through the allow="" attribute or simply disallow requesting it in third-party contexts. Disabling is what we've been doing for most unusual permissions and seems reasonable here too.

Keywords: site-compat

James, could you confirm this is okay for mobile? Perhaps you should also review bug 1572461 as some of that likely impacts mobile too.

Flags: needinfo?(snorp)

Yeah, just disabling seems fine to me.

Flags: needinfo?(snorp)
Pushed by
Remove support for third-party vibrate r=baku,snorp
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Assignee: nobody → tnguyen

Correct me if I'm wrong, but this patch uses {"vibration", nullptr, DelegatePolicy::ePersistDeniedCrossOrigin}, which for top-level documents ends up in

Unless the permission is explicitly set, this fails for all origins by default, so navigator.vibrate() only works in chrome:// documents out of the box.

Fabrice, wouldn't that mean that also does not work (it does)? works because we end up prompting the user to grant the permission with

But navigator.vibrate() just silently returns true.

Regressions: 1653318

Cross posting on this same issue on Github;

As a [mostly] web dev w/ 25+ years experience, I have been waiting years for PWA's to really arrive. Put up a simple japa counter example this weekend, and it's amazing, seems finally ready for prime time. However, my favorite mobile browser and daily driver falls a bit short.

Firefox Mobile doesn't support the Vibrate API (again, as of March 9, 2022). Not due to an actual technical issue, but because it was disabled due to abuse by shady websites.

FF Mobile renders the PWA much better as a "real" app, changing the android notification bar the theme color. And of course, FF is my daily driver, and I evangelize whenever possible and would prefer to use it everywhere. However, lack of vibration API support really skews that. The fact that FF has a worse PWA developer experience than all the chromium derivatives seems wrong on many levels.

Looked at the Fenix source, after tracing several other bug reports w/ patches, but clearly, nothing for current code base. Kotlin isn't too crazy different to at least poke around. Closest hackable section I found was the QR code section, which imported the Android vibrate API, and is clearly coded to vibrate, but doesn't. So the disabling is elsewhere that I couldn't track down...

My understanding from parsing bug reports here, on Github, and reddit, is that Fenix developers disabled this due to abuse, not technical issues, and can't quite figure out how to properly surface a user permission prompt on a per site basis.

Seems like a test for "am I installed as a PWA" and "am I active" might be a workaround. This wouldn't solve the [apparently thorny] per site permission issue, but would give developers the FF powered mobile app we desire...

See Also: → 1810000
You need to log in before you can comment on or make changes to this bug.