Contact emails
[email protected],[email protected],[email protected]
Explainer
None
Specification
https://w3c.github.io/deviceorientation
Summary
Allows developers to ask for permission to start using the Device
Orientation and Device Motion APIs. Access to these APIs is currently
granted by default, and these new functions are part of the plan to
start prompting for access in the future.
Blink component
Blink>Sensor>DeviceOrientation
<https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3ESensor%3EDeviceOrientation>
Motivation
The Device Orientation spec is more than a decade old, at a time when
integration with the Permissions spec was not common (or possible). As
such, developers can use the window.ondevice{motion,orientation} events
without having to ask for permission before reading sensor data. A few
years ago, the WebKit team added the requestPermission() functions to
DeviceOrientationEvent and DeviceMotionEvent when implementing the spec,
so that websites would have to ask for permission before being able to
use the API. This is the case on Safari for iOS at the moment. We want
to do the same thing and avoid allowing websites access to sensor data
by default. Doing this in Chromium is more complicated because the API
is already implemented, and requiring developers to add
requestPermission() to their websites out of the blue can risk breaking
the web. In this first step, the idea is to just add the API and make it
report "granted" or "denied" without prompting for access (i.e. it just
reports the current Motion Sensor permission settings) while also adding
user counters to understand how many pages are already using the
requestPermission() calls and how many pages are just using
window.ondevice{motion,orientation} without it. We will then evaluate
how to switch to prompting by default in the future, as discussed in the
tracking bug.
Initial public proposal
Search tags
device orientation
<https://chromestatus.com/features#tags:device%20orientation>,device
motion <https://chromestatus.com/features#tags:device%20motion>
TAG review
TAG review status
Not applicable
Risks
Interoperability and Compatibility
/Gecko/: Under consideration
(https://bugzilla.mozilla.org/show_bug.cgi?id=1536382)
/WebKit/: Shipped/Shipping (https://bugs.webkit.org/show_bug.cgi?id=195329)
/Web developers/: No signals
/Other signals/: Lots of comments in the Chromium tracking bug over the
years
WebView application risks
Does this intent deprecate or change behavior of existing APIs, such
that it has potentially high risk for Android WebView-based applications?
Debuggability
-
Is this feature fully tested byweb-platform-tests
<https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md>?
Yes (as part of the CL I am working on)
Flag name
Requires code in //chrome?
False
Tracking bug
https://bugs.chromium.org/p/chromium/issues/detail?id=947112
Estimated milestones
No milestones specified
Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5051845089689600
This intent message was generated byChrome Platform Status
<https://chromestatus.com/>.
--
You received this message because you are subscribed to the Google Groups
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/a7bfbf70-0cbf-709f-6310-7af1101c2574%40intel.com.