window.DeviceMotionEvent should not be defined if the hardware cannot provide accelerometer data

NEW
Unassigned

Status

()

P3
normal
6 years ago
11 months ago

People

(Reporter: alice.lieutier, Unassigned)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Created attachment 722160 [details]
testcase

There should be a way for web developpers to know if they can use the DeviceMotionEvent on the browser they use with the hardware they use.

Currently, window.DeviceMotionEvent is always exposed in Firefox, even when the hardware does not provide information about the device motion (e.g. on most desktop).

I attached a simple feature sniff for DeviceMotionEvent.

Here is a page that records data from DeviceMotionEvent:
http://alicelieutier.github.com/skiptherope/accelerometer.html
Can we have a method that adds the method in the window interface based on the availability of the feature with WebIDL? Doug, do we have a way to know that upfront?
Doug, is there any way for Gecko to know if DeviceMotionEvent is supported by the system? For example, SSD disks don't give that support even if we have a MacOS X backend.
Flags: needinfo?(doug.turner)
we could do more than we do now, for sure.
Flags: needinfo?(doug.turner)
You need to log in before you can comment on or make changes to this bug.