Open Bug 1842454 Opened 1 year ago Updated 7 months ago

Remove dom.webnotifications.requireuserinteraction pref

Categories

(Core :: DOM: Notifications, task)

task

Tracking

()

People

(Reporter: gregp, Unassigned)

References

(Blocks 1 open bug)

Details

The user activation requirement for prompting users to enable notifications has been enabled for about 4 years now (bug 1593644). Let's remove this feature rollout pref

Fixing this bug will require updating some GeckoView tests and mochitests to not rely on this pref. Not sure if there's some helper method that simulates user activation which could be used instead.

We can port mochitests to WPT instead, which mochitest fails there?

Hmm, seems I got confused earlier. There's only one plain mochitest that touches this pref and its setting it to true, so it shouldn't be an issue.
https://searchfox.org/mozilla-central/search?q=dom[-_.]webnotifications[-_.]requireuserinteraction&path=.html&regexp=true

There's a few browser tests that will fail, like this one.
https://searchfox.org/mozilla-central/rev/ea550f0d1afaf7747ebd988325ea10cf4e3e4de4/browser/base/content/test/fullscreen/browser_fullscreen_permissions_prompt.js#38
It looks like this test is just making sure that the browser exits fullscreen when a doorhanger appears. we could update the test to request geolocation access, which should cause a doorhanger to appear, fulfilling the requirements of the test.

There's also some GV tests that fail with the pref removed
https://searchfox.org/mozilla-central/rev/ea550f0d1afaf7747ebd988325ea10cf4e3e4de4/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/PermissionDelegateTest.kt#663

we could update the test to request geolocation access

Does it not require user interaction? That's interesting, does the spec not require it?

Flags: needinfo?(gp3033)

(In reply to Kagami [:saschanaz] from comment #4)

Does it not require user interaction? That's interesting, does the spec not require it?

Yeah requesting geolocation access does require user interaction, I'm not sure why i suggested that, It wont work.

Flags: needinfo?(gp3033)

Ok I just found this ChromeOnly notifyUserGestureActivation method, perhaps we could use it.
https://searchfox.org/mozilla-central/rev/ea550f0d1afaf7747ebd988325ea10cf4e3e4de4/dom/webidl/Document.webidl#563

BTW, note that this is still nonstandard. I don't think we'll want to unship this, but perhaps worth keeping the flag? https://github.com/whatwg/notifications/issues/108

Flags: needinfo?(gp3033)

Sounds good, I'll hold off on doing this then.

Flags: needinfo?(gp3033)
Component: DOM: Push Subscriptions → DOM: Notifications
You need to log in before you can comment on or make changes to this bug.