Open Bug 1805110 Opened 2 years ago Updated 2 years ago

Sometimes randomly, devicemotion events are not fired until first click

Categories

(Core :: DOM: Device Interfaces, defect, P3)

Firefox 107
defect

Tracking

()

UNCONFIRMED

People

(Reporter: php4funs, Unassigned)

Details

Firefox for Android

Steps to reproduce:

window.addEventListener('devicemotion', function(e) {
console.log("devicemotion event");
});

Actual results:

Sometimes, events don't start getting fired until you touch the screen.
Then, if you reload the page, they will start getting fired immediately.

I reproduced this consistently a few times. I would load a different page, then go to the test page, and events wouldn't fire until I would click, and then they would fire immediately on reload.

But then, I started getting random results. I visited a different unrelated page on another domain and it started firing events immediately. I went back to my test page and it did the same.

Expected results:

Should either start firing events immediately (or never, if the hardware doesn't support them), or require asking for permissions in a standard way.

If any attempt to only start firing events after a user interaction is by design, it is a wrong design that makes no sense and obeys no standard, and it also doesn't work consistently as it's utterly random.

Tested on Android

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Events' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Events
Product: Firefox → Core
Component: DOM: Events → DOM: Device Interfaces

The severity field is not set for this bug.
:cmartin, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cmartin)
Severity: -- → S3
Flags: needinfo?(cmartin)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.