方向传感器

W3C 工作草案

关于本文档的更多详细信息
此版本:
https://www.w3.org/TR/2026/WD-orientation-sensor-20260514/
最新发布版本:
https://www.w3.org/TR/orientation-sensor/
编辑者草案:
https://w3c.github.io/orientation-sensor/
先前版本:
历史:
https://www.w3.org/standards/history/orientation-sensor/
反馈:
public-device-apis@w3.org 主题行写为“[orientation-sensor] … 消息主题 …”(归档
方向传感器问题 仓库
编辑者:
Kenneth Rohde ChristiansenIntel Corporation
Anssi KostiainenIntel Corporation
前编辑者:
Mikhail PozdnyakovIntel Corporation
Alexander ShalamovIntel Corporation
测试套件:
GitHub 上的 web-platform-tests

摘要

本规范定义了一个基础方向传感器接口和具体的传感器子类,用于监测 设备相对于静止三维笛卡尔坐标系的 物理方向。

本文档状态

本节描述本文档在发布时的状态。 当前 W3C 出版物列表以及本技术报告的最新修订版 可在 W3C 技术报告 索引中找到。

本文档由 Devices and Sensors 工作组 使用推荐标准 轨道作为工作草案发布。本文档旨在成为 W3C 推荐标准。

如果你希望对本文档发表评论,请将评论发送至 public-device-apis@w3.org订阅归档)。 发送电子邮件时, 请将文本 “orientation-sensor” 放在主题中, 最好像这样: “[orientation-sensor] …评论摘要…”。 欢迎所有评论。

作为工作草案发布并不意味着得到 W3C 及其会员的认可。这是一份草案文档, 可能会在任何时候被其他文档更新、替换或 废弃。除作为正在进行中的工作外,不应引用本文档。

本文档由一个根据 W3C 专利政策运作的工作组制作。 W3C 维护一个任何专利 披露的公开列表, 这些披露与该工作组的交付物有关; 该页面还包括披露专利的说明。 任何实际知晓某项专利且认为该专利包含必要权利要求的个人, 必须按照 W3C 专利政策第 6 节 披露相关信息。

本文档受 2025年8月18日 W3C 流程文档约束。

本规范为现有部署而维护。多个浏览器引擎已经 表达了对本规范的担忧。对于新项目,开发者应使用设备方向和运动,它具有 跨引擎支持。工作组打算在设备方向和运动中开发新的运动感测功能。

Devices and Sensors 工作组正在为本规范推进现代安全和隐私 审查,以考虑自横向审查于 2019年10月14日进行以来, 本规范以及隐私和安全审查实践中发生的大量变化。同样,该工作组正在为本规范推进 Technical Architecture Group 审查的更新,以适应最新的 架构审查实践。

1. 引言

Orientation Sensor API 扩展了 Generic Sensor API [GENERIC-SENSOR], 以提供描述设备相对于三维笛卡尔坐标系的物理方向的 通用信息。

AbsoluteOrientationSensor 类继承自 OrientationSensor 接口,并 描述设备相对于地球 参考坐标系的物理方向。

其他子类描述相对于其他静止方向(如真北)或 非静止方向的方向,例如相对于设备自身的 z 位置, 并向其最近最稳定的 z 位置漂移。

OrientationSensor 子类提供的数据类似于 DeviceOrientationEvent 的数据, 但 Orientation Sensor API 有以下显著差异:

  1. Orientation Sensor API 以兼容 WebGL 的格式(四元数、 旋转矩阵)表示方向数据。

  2. Orientation Sensor API 满足更严格的延迟要求。

  3. 不同于 DeviceOrientationEventOrientationSensor 子类会明确界定使用哪些低级 运动传感器来获得方向数据,从而避免可能的互操作性 问题。

  4. OrientationSensor 子类的实例可通过 SensorOptions 构造函数参数进行配置。

2. 用例和要求

用例和要求在 Motion Sensors Explainer 文档中讨论。

3. 示例

const sensor = new AbsoluteOrientationSensor();
const mat4 = new Float32Array(16);
sensor.start();
sensor.onerror = event => console.log(event.error.name, event.error.message);

sensor.onreading = () => {
  sensor.populateMatrix(mat4);
};
const sensor = new AbsoluteOrientationSensor({ frequency: 60 });
const mat4 = new Float32Array(16);
sensor.start();
sensor.onerror = event => console.log(event.error.name, event.error.message);

function draw(timestamp) {
  window.requestAnimationFrame(draw);
  try {
    sensor.populateMatrix(mat4);
  } catch(e) {
    // mat4 尚未更新。
  }
  // 绘制...
}

window.requestAnimationFrame(draw);

4. 安全和隐私考量

除了 Generic Sensor API [GENERIC-SENSOR] 中描述的内容之外, 没有特定的安全和隐私考量。

5. 模型

OrientationSensor 类扩展 Sensor 类,并提供表示设备方向数据的 通用接口。

要访问 Orientation Sensor 传感器类型最新读数,用户 代理必须针对具体方向传感器使用的每个低级传感器调用 请求传感器访问抽象操作。下表 描述了具体方向传感器与低级传感器定义的权限令牌之间的映射。

OrientationSensor 子类 权限令牌
AbsoluteOrientationSensor "accelerometer"、"gyroscope"、"magnetometer"
RelativeOrientationSensor "accelerometer"、"gyroscope"

AbsoluteOrientationSensor 是一个受策略控制的特性,由字符串 "accelerometer"、"gyroscope" 和 "magnetometer" 标识。其默认允许列表'self'

RelativeOrientationSensor 是一个受策略控制的特性,由字符串 "accelerometer" 和 "gyroscope" 标识。其默认允许列表'self'

最新读数对于一个Orientation Sensor 传感器 类型Sensor 而言,包含一个条目, 其为 "quaternion",其包含一个四元素列表。 该列表的元素等于单位四元数的分量 [QUATERNIONS] [Vx * sin(θ/2), Vy * sin(θ/2), Vz * sin(θ/2), cos(θ/2)],其中 V 是 表示旋转轴的单位向量(其元素为 Vx、Vy 和 Vz), θ 是绕单位向量 V 所定义轴的旋转角。

注:四元数分量在列表中排列为 [q1, q2, q3, q0] [QUATERNIONS],也就是说, 表示四元数向量部分的分量在前,而等于 cos(θ/2) 的标量部分分量 在后。采用该顺序是为了更好地兼容大多数现有 WebGL 框架, 但其他库在将四元数暴露为数组时可能使用不同顺序,例如 [q0, q1, q2, q3]。

通过传感器融合低级运动传感器而创建的具体 OrientationSensor 子类如下表所示:

OrientationSensor 子类 低级运动传感器
AbsoluteOrientationSensor AccelerometerGyroscopeMagnetometer
RelativeOrientationSensor AccelerometerGyroscope

注:AccelerometerGyroscopeMagnetometer 低级传感器分别定义于 [ACCELEROMETER][GYROSCOPE][MAGNETOMETER] 规范。传感器融合是平台特定的,可以发生在软件中,也可以发生在 硬件中,即发生在传感器集线器上。

此示例代码会在调用 start() 之前,显式查询 AbsoluteOrientationSensor 的权限。
const sensor = new AbsoluteOrientationSensor();
Promise.all([navigator.permissions.query({ name: "accelerometer" }),
             navigator.permissions.query({ name: "magnetometer" }),
             navigator.permissions.query({ name: "gyroscope" })])
       .then(results => {
             if (results.every(result => result.state === "granted")) {
               sensor.start();
               ...
             } else {
               console.log("没有使用 AbsoluteOrientationSensor 的权限。");
             }
       });

另一种做法是直接调用 start() 并订阅 onerror 事件处理器

const sensor = new AbsoluteOrientationSensor();
sensor.onerror = event => {
  if (event.error.name === 'NotAllowedError')
    console.log("没有使用 AbsoluteOrientationSensor 的权限。");
};
sensor.start();

5.1. AbsoluteOrientationSensor 模型

Absolute Orientation Sensor 传感器类型表示 Motion Sensors Explainer § absolute-orientation 中描述的传感器。其关联的扩展传感器接口AbsoluteOrientationSensor, 它是 OrientationSensor 的子类。 其关联的虚拟传感器类型是 "absolute-orientation"。

对于绝对方向传感器,最新 读数["quaternion"] 的值表示 设备局部 坐标系相对于地球参考 坐标系的旋转,后者被定义为三维笛卡尔坐标系(x、y、z),其中:

设备的局部坐标系低级 运动传感器所定义的相同。它可以是设备坐标系,也可以是 屏幕坐标系

注:下图表示设备的局部坐标系地球 参考坐标系对齐的情况,因此, 方向传感器的最新读数将表示绕每个轴 0(rad)[SI] 旋转。

AbsoluteOrientationSensor 坐标系。

5.2. RelativeOrientationSensor 模型

Relative Orientation Sensor 传感器类型表示 Motion Sensors Explainer § relative-orientation 中描述的传感器。其关联的扩展传感器接口RelativeOrientationSensor, 它是 OrientationSensor 的子类。 其关联的虚拟传感器类型是 "relative-orientation"。

对于相对方向传感器,最新 读数["quaternion"] 的值表示 设备局部坐标系相对于静止参考坐标系的 旋转。静止参考坐标系可能会由于 陀螺仪传感器引入的偏差而漂移,因此,该传感器提供的旋转值可能会随时间漂移。

静止参考坐标系定义为 惯性三维笛卡尔坐标系,在承载传感器的设备穿过 环境移动时保持静止。

设备的局部坐标系低级 运动传感器所定义的相同。它可以是设备坐标系,也可以是 屏幕坐标系

注:相对方向传感器数据可能比绝对 方向传感器提供的数据更准确,因为该传感器不受磁场影响。

6. API

6.1. OrientationSensor 接口

typedef (Float32Array or Float64Array or DOMMatrix) RotationMatrixType;

[SecureContext, Exposed=Window]
interface OrientationSensor : Sensor {
  readonly attribute FrozenArray<double>? quaternion;
  undefined populateMatrix(RotationMatrixType targetMatrix);
};

enum OrientationSensorLocalCoordinateSystem { "device", "screen" };

dictionary OrientationSensorOptions : SensorOptions {
  OrientationSensorLocalCoordinateSystem referenceFrame = "device";
};

6.1.1. OrientationSensor.quaternion

返回一个四元素 FrozenArray, 其元素包含表示设备方向的 单位四元数分量。 换句话说,此属性返回以 this 和 "quaternion" 作为参数调用 从最新读数获取值的结果。

6.1.2. OrientationSensor.populateMatrix()

populateMatrix(targetMatrix) 方法步骤为:
  1. 如果 targetMatrix 的类型为 Float32ArrayFloat64Array, 且大小小于十六,则抛出一个 "TypeError" 异常并中止这些步骤。

  2. quaternion 为以 this 和 "quaternion" 作为参数调用从最新读数获取值的结果。

  3. 如果 quaternionnull,则抛出一个 "NotReadableError" DOMException 并中止这些步骤。

  4. rotationMatrix 为以 quaternion[0]、quaternion[1]、 quaternion[2] 和 quaternion[3] 将四元数转换为旋转 矩阵的结果。

  5. 如果 targetMatrix 属于 Float32ArrayFloat64Array 类型,则运行这些子步骤:

    1. 设置 targetMatrix[0] = rotationMatrix[0]

    2. 设置 targetMatrix[1] = rotationMatrix[1]

    3. 设置 targetMatrix[2] = rotationMatrix[2]

    4. 设置 targetMatrix[3] = rotationMatrix[3]

    5. 设置 targetMatrix[4] = rotationMatrix[4]

    6. 设置 targetMatrix[5] = rotationMatrix[5]

    7. 设置 targetMatrix[6] = rotationMatrix[6]

    8. 设置 targetMatrix[7] = rotationMatrix[7]

    9. 设置 targetMatrix[8] = rotationMatrix[8]

    10. 设置 targetMatrix[9] = rotationMatrix[9]

    11. 设置 targetMatrix[10] = rotationMatrix[10]

    12. 设置 targetMatrix[11] = rotationMatrix[11]

    13. 设置 targetMatrix[12] = rotationMatrix[12]

    14. 设置 targetMatrix[13] = rotationMatrix[13]

    15. 设置 targetMatrix[14] = rotationMatrix[14]

    16. 设置 targetMatrix[15] = rotationMatrix[15]

  6. 如果 targetMatrix 属于 DOMMatrix 类型,则运行这些子步骤:

    1. 设置 targetMatrix.m11 = rotationMatrix[0]

    2. 设置 targetMatrix.m12 = rotationMatrix[1]

    3. 设置 targetMatrix.m13 = rotationMatrix[2]

    4. 设置 targetMatrix.m14 = rotationMatrix[3]

    5. 设置 targetMatrix.m21 = rotationMatrix[4]

    6. 设置 targetMatrix.m22 = rotationMatrix[5]

    7. 设置 targetMatrix.m23 = rotationMatrix[6]

    8. 设置 targetMatrix.m24 = rotationMatrix[7]

    9. 设置 targetMatrix.m31 = rotationMatrix[8]

    10. 设置 targetMatrix.m32 = rotationMatrix[9]

    11. 设置 targetMatrix.m33 = rotationMatrix[10]

    12. 设置 targetMatrix.m34 = rotationMatrix[11]

    13. 设置 targetMatrix.m41 = rotationMatrix[12]

    14. 设置 targetMatrix.m42 = rotationMatrix[13]

    15. 设置 targetMatrix.m43 = rotationMatrix[14]

    16. 设置 targetMatrix.m44 = rotationMatrix[15]

6.2. AbsoluteOrientationSensor 接口

[SecureContext, Exposed=Window]
interface AbsoluteOrientationSensor : OrientationSensor {
  constructor(optional OrientationSensorOptions sensorOptions = {});
};

要构造 AbsoluteOrientationSensor 对象,用户代理必须为 AbsoluteOrientationSensor 接口调用构造方向传感器对象抽象 操作。

AbsoluteOrientationSensor支持的传感器选项 是 "frequency" 和 "referenceFrame"。

6.3. RelativeOrientationSensor 接口

[SecureContext, Exposed=Window]
interface RelativeOrientationSensor : OrientationSensor {
  constructor(optional OrientationSensorOptions sensorOptions = {});
};

要构造 RelativeOrientationSensor 对象,用户代理必须为 RelativeOrientationSensor 接口调用构造方向传感器对象抽象 操作。

RelativeOrientationSensor支持的传感器选项 是 "frequency" 和 "referenceFrame"。

7. 抽象操作

7.1. 构造 Orientation Sensor 对象

输入

orientation_interface,一个接口标识符,其继承接口包含 OrientationSensor

options,一个 OrientationSensorOptions 对象。

输出

一个 OrientationSensor 对象。

  1. allowed 为以 orientation_interface 标识的接口调用检查传感器受策略控制 特性 的结果。

  2. 如果 allowed 为 false,则:

    1. 抛出一个 SecurityError DOMException

  3. orientation 为由 orientation_interface 标识的接口的一个新实例。

  4. orientationoptions 调用 初始化传感器对象

  5. 如果 options.referenceFrame 为 "screen",则:

    1. orientation局部坐标系 定义为屏幕坐标系

  6. 否则,将 orientation局部坐标系 定义为设备坐标系

  7. 返回 orientation

7.2. 将四元数转换为旋转矩阵

将四元数转换为旋转矩阵 算法创建一个按列主序表示的旋转矩阵列表,该矩阵从四元数 [QUATCONV] 转换而来,如下所示:

将四元数转换为旋转矩阵。

其中:

给定一个数 x、一个数 y、一个数 z 和一个数 w,要将四元数转换为旋转 矩阵
  1. m11 为 1 - 2 * y * y - 2 * z * z

  2. m12 为 2 * x * y - 2 * z * w

  3. m13 为 2 * x * z + 2 * y * w

  4. m14 为 0

  5. m21 为 2 * x * y + 2 * z * w

  6. m22 为 1 - 2 * x * x - 2 * z * z

  7. m23 为 2 * y * z - 2 * x * w

  8. m24 为 0

  9. m31 为 2 * x * z - 2 * y * w

  10. m32 为 2 * y * z + 2 * x * w

  11. m33 为 1 - 2 * x * x - 2 * y * y

  12. m34 为 0

  13. m41 为 0

  14. m42 为 0

  15. m43 为 0

  16. m44 为 1

  17. 返回 « m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44 »。

7.3. 从欧拉角创建四元数

给定一个数 alpha、一个数 beta 和一个数 gamma,要从欧拉角创建四元数

  1. alphaInRadians 为从度转换为弧度后的 alpha

  2. betaInRadians 为从度转换为弧度后的 beta

  3. gammaInRadians 为从度转换为弧度后的 gamma

  4. cosZ 为 (0.5 * alphaInRadians) 的余弦。

  5. sinZ 为 (0.5 * alphaInRadians) 的正弦。

  6. cosX 为 (0.5 * betaInRadians) 的余弦。

  7. sinX 为 (0.5 * betaInRadians) 的正弦。

  8. cosY 为 (0.5 * gammaInRadians) 的余弦。

  9. sinY 为 (0.5 * gammaInRadians) 的正弦。

  10. quaternionX 为 (sinX * cosY * cosZ - cosX * sinY * sinZ)。

  11. quaternionY 为 (cosX * sinY * cosZ + sinX * cosY * sinZ)。

  12. quaternionZ 为 (cosX * cosY * sinZ + sinX * sinY * cosZ)。

  13. quaternionW 为 (cosX * cosY * cosZ - sinX * sinY * sinZ)。

  14. 返回 « quaternionX, quaternionY, quaternionZ, quaternionW »。

8. 自动化

本节通过提供 Orientation Sensor 特有的虚拟传感器元数据,扩展 Generic Sensor API § 9 Automation

8.1. 对其他规范的修改

本规范按如下方式与 Device Orientation and Motion § automation 集成。

解析方向数据读数算法修改 如下:

注:本规范目前没有提供一种 在 WebDriver 中直接指定四元数(并因此从四元数推导欧拉角)的方法。 作出此决定是出于简化考虑,并基于如下假设:自动化用户更可能 使用欧拉角作为输入(或选择特定四元数值,并自行提供对应的 欧拉角值)。欢迎有不同用例且有兴趣能够直接提供四元数值的用户,通过本规范的问题跟踪器提供反馈。

8.2. 绝对方向传感器自动化

absolute-orientation 虚拟传感器类型及其在每类型虚拟传感器元数据映射中的对应条目, 定义于 Device Orientation and Motion § automation

8.3. 相对方向传感器自动化

relative-orientation 虚拟传感器类型及其在每类型虚拟传感器元数据映射中的对应条目, 定义于 Device Orientation and Motion § automation

9. 致谢

感谢 Tobie Langel 在 Generic Sensor API 上所做的工作。

一致性

文档 约定

一致性要求通过描述性断言 和 RFC 2119 术语的组合来表达。 本文档规范性部分中的关键词 “MUST”、“MUST NOT”、“REQUIRED”、“SHALL”、“SHALL NOT”、“SHOULD”、“SHOULD NOT”、“RECOMMENDED”、 “MAY” 和 “OPTIONAL” 应按 RFC 2119 中的描述来解释。 但是,为了可读性, 这些词在本规范中并不全部以大写字母出现。

除明确标记为非规范性的章节、示例和注释外, 本规范的所有文本均为规范性文本。[RFC2119]

本规范中的示例会用 “for example” 一词引入, 或者使用 class="example" 与规范性文本分离, 如下所示:

这是一个资料性示例的例子。

资料性注释以 “Note” 一词开头, 并使用 class="note" 与规范性文本分离, 如下所示:

注,这是一个资料性注释。

一致性 算法

作为算法一部分以祈使语气表述的要求 (例如 "strip any leading space characters" 或 "return false and abort these steps") 应根据引入该算法时使用的关键词 ("must"、"should"、"may" 等) 的含义来解释。

以算法或具体步骤表述的一致性要求 可以用任何方式实现, 只要最终结果是等价的。 特别是,本规范中定义的算法 旨在易于理解, 并非旨在具备高性能。 鼓励实现者进行优化。

索引

本规范定义的 术语

由引用定义的 术语

参考文献

规范性参考文献

[ACCELEROMETER]
Anssi Kostiainen. 加速度计. 2026年5月14日。 CRD。URL:https://www.w3.org/TR/accelerometer/
[GENERIC-SENSOR]
Rick Waldron. Generic Sensor API. 2026年5月14日。 CRD。URL:https://www.w3.org/TR/generic-sensor/
[GEOMETRY-1]
Sebastian Zartner; Yehonatan Daniv. Geometry Interfaces Module Level 1. 2025年12月4日。CRD。URL:https://www.w3.org/TR/geometry-1/
[GYROSCOPE]
Anssi Kostiainen. 陀螺仪. 2026年5月14日。CRD。 URL:https://www.w3.org/TR/gyroscope/
[INFRA]
Anne van Kesteren; Domenic Denicola. Infra 标准. 现行标准。URL:https://infra.spec.whatwg.org/
[MAGNETOMETER]
Anssi Kostiainen; Rijubrata Bhaumik. 磁力计. 2026年5月14日。WD。URL:https://www.w3.org/TR/magnetometer/
[MOTION-SENSORS]
Kenneth Christiansen; Alexander Shalamov. Motion Sensors Explainer. 2017年8月30日。NOTE。URL:https://www.w3.org/TR/motion-sensors/
[ORIENTATION-EVENT]
Reilly Grant; Marcos Caceres. Device Orientation and Motion. 2025年2月12日。CRD。URL:https://www.w3.org/TR/orientation-event/
[PERMISSIONS-POLICY-1]
Ian Clelland. Permissions Policy. 2025年10月6日。 WD。URL:https://www.w3.org/TR/permissions-policy-1/
[RFC2119]
S. Bradner. RFC 中用于表示要求级别的 关键词. 1997年3月。最佳当前实践。URL:https://datatracker.ietf.org/doc/html/rfc2119
[WEBIDL]
Edgar Chen; Timothy Gu. Web IDL 标准. 活 标准。URL:https://webidl.spec.whatwg.org/

非规范性参考文献

[HTML]
Anne van Kesteren; et al. HTML 标准. 现行标准。URL:https://html.spec.whatwg.org/multipage/
[QUATCONV]
Watt, Alan H., and Mark Watt.. 高级 动画和渲染技术,第 362 页. 1992。资料性。URL:https://www.cs.cmu.edu/afs/cs/academic/class/15462-s14/www/lec_slides/3DRotationNotes.pdf
[QUATERNIONS]
四元数. URL:https://en.wikipedia.org/wiki/Quaternion
[SI]
SI 手册:国际单位制(SI),第 8 版. 2014。第 8 版。URL:http://www.bipm.org/en/publications/si-brochure/

IDL 索引

typedef (Float32Array or Float64Array or DOMMatrix) RotationMatrixType;

[SecureContext, Exposed=Window]
interface OrientationSensor : Sensor {
  readonly attribute FrozenArray<double>? quaternion;
  undefined populateMatrix(RotationMatrixType targetMatrix);
};

enum OrientationSensorLocalCoordinateSystem { "device", "screen" };

dictionary OrientationSensorOptions : SensorOptions {
  OrientationSensorLocalCoordinateSystem referenceFrame = "device";
};

[SecureContext, Exposed=Window]
interface AbsoluteOrientationSensor : OrientationSensor {
  constructor(optional OrientationSensorOptions sensorOptions = {});
};

[SecureContext, Exposed=Window]
interface RelativeOrientationSensor : OrientationSensor {
  constructor(optional OrientationSensorOptions sensorOptions = {});
};

MDN

AbsoluteOrientationSensor/AbsoluteOrientationSensor

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

AbsoluteOrientationSensor

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

OrientationSensor/populateMatrix

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

OrientationSensor/quaternion

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

OrientationSensor

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

RelativeOrientationSensor/RelativeOrientationSensor

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?
MDN

RelativeOrientationSensor

In only one current engine.

FirefoxNoneSafariNoneChrome67+
Opera?Edge79+
Edge (Legacy)?IENone
Firefox for Android?iOS Safari?Chrome for Android?Android WebView?Samsung Internet?Opera Mobile?