Skip to content

Commit

Permalink
Sensor API | add secure context tag & add constructor params (mdn#32038)
Browse files Browse the repository at this point in the history
* update front matter key - spec_url

* update section title

* update macros

* add optional_inline mark

* update browser-compat key
  • Loading branch information
skyclouds2001 authored Feb 1, 2024
1 parent 256a912 commit 4ea748e
Show file tree
Hide file tree
Showing 42 changed files with 79 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-constructor
browser-compat: api.AbsoluteOrientationSensor.AbsoluteOrientationSensor
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`AbsoluteOrientationSensor()`** constructor creates a new {{domxref("AbsoluteOrientationSensor")}} object which describes the device's physical orientation in relation to the Earth's reference coordinate system.

Expand All @@ -23,9 +23,9 @@ new AbsoluteOrientationSensor(options)

- : Options are as follows:

- `frequency`
- `frequency` {{optional_inline}}
- : The desired number of times per second a sample should be taken, meaning the number of times per second that the {{domxref('sensor.reading_event', 'reading')}} event will be called. A whole number or decimal may be used, the latter for frequencies less than a second. The actual reading frequency depends on the device hardware and consequently may be less than requested.
- `referenceFrame`
- `referenceFrame` {{optional_inline}}
- : Either `'device'` or `'screen'`. The default is `'device'`.

## Specifications
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/absoluteorientationsensor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page-type: web-api-interface
browser-compat: api.AbsoluteOrientationSensor
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`AbsoluteOrientationSensor`** interface of the [Sensor APIs](/en-US/docs/Web/API/Sensor_APIs) describes the device's physical orientation in relation to the Earth's reference coordinate system.

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/accelerometer/accelerometer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status:
browser-compat: api.Accelerometer.Accelerometer
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`Accelerometer()`** constructor creates a new {{domxref("Accelerometer")}} object which returns the acceleration of the device along all three axes at the time it is read.

Expand All @@ -25,9 +25,9 @@ new Accelerometer(options)

- : Options are as follows:

- `frequency`
- `frequency` {{optional_inline}}
- : The desired number of times per second a sample should be taken, meaning the number of times per second the {{domxref('sensor.reading_event', 'reading')}} event will be called. A whole number or decimal may be used, the latter for frequencies less than a second. The actual reading frequency depends on the device hardware and consequently may be less than requested.
- `referenceFrame`
- `referenceFrame` {{optional_inline}}
- : Either `'device'` or `'screen'`. The default is `'device'`.

### Exceptions
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/accelerometer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ status:
browser-compat: api.Accelerometer
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`Accelerometer`** interface of the [Sensor APIs](/en-US/docs/Web/API/Sensor_APIs) provides on each reading the acceleration applied to the device along all three axes.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/accelerometer/x/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status:
browser-compat: api.Accelerometer.x
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`x`** read-only property of the {{domxref("Accelerometer")}} interface returns a number specifying the acceleration of the device along its x-axis.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/accelerometer/y/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status:
browser-compat: api.Accelerometer.y
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`y`** read-only property of the {{domxref("Accelerometer")}} interface returns a number specifying the acceleration of the device along its y-axis.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/accelerometer/z/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status:
browser-compat: api.Accelerometer.z
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`z`** read-only property of the {{domxref("Accelerometer")}} interface returns a number specifying the acceleration of the device along its z-axis.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status:
browser-compat: api.AmbientLightSensor.AmbientLightSensor
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`AmbientLightSensor()`** constructor creates a new {{domxref("AmbientLightSensor")}} object, which returns the current light level or illuminance of the ambient light around the hosting device.

Expand All @@ -25,7 +25,7 @@ new AmbientLightSensor(options)

- : Currently only one option is supported:

- `frequency`
- `frequency` {{optional_inline}}
- : The desired number of times per second a sample should be taken, meaning the number of times per second that {{domxref('sensor.reading_event', 'reading')}} event will be called. A whole number or decimal may be used, the latter for frequencies less than a second. The actual reading frequency depends on the device hardware and consequently may be less than requested.

### Exceptions
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/ambientlightsensor/illuminance/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ status:
browser-compat: api.AmbientLightSensor.illuminance
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`illuminance`** property of the {{domxref("AmbientLightSensor")}} interface returns the current light level in [lux](https://en.wikipedia.org/wiki/Lux) of the ambient light level around the hosting device.
The **`illuminance`** read-only property of the {{domxref("AmbientLightSensor")}} interface returns the current light level in [lux](https://en.wikipedia.org/wiki/Lux) of the ambient light level around the hosting device.

## Value

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/ambientlightsensor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ status:
browser-compat: api.AmbientLightSensor
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`AmbientLightSensor`** interface of the [Sensor APIs](/en-US/docs/Web/API/Sensor_APIs) returns the current light level or illuminance of the ambient light around the hosting device.

Expand All @@ -24,7 +24,7 @@ This feature may be blocked by a [Permissions Policy](/en-US/docs/Web/HTTP/Permi

## Instance properties

- {{domxref('AmbientLightSensor.illuminance')}} {{Experimental_Inline}}
- {{domxref('AmbientLightSensor.illuminance')}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Returns the current light level in [lux](https://en.wikipedia.org/wiki/Lux) of the ambient light level around the hosting device.

## Instance methods
Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/gravitysensor/gravitysensor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-constructor
browser-compat: api.GravitySensor.GravitySensor
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`GravitySensor()`**
constructor creates a new {{domxref("GravitySensor")}} object which
Expand All @@ -25,14 +25,14 @@ new GravitySensor(options)

- : Options are as follows:

- `frequency`
- `frequency` {{optional_inline}}
- : The desired number of times per second a sample should
be taken, meaning the number of times per second that the
{{domxref('sensor.reading_event', 'reading')}} event will be called. A whole number or decimal may be
used, the latter for frequencies less than a second. The actual reading frequency
depends on device hardware and consequently may be less than requested. The default
frequency is the one defined by the underlying platform.
- `referenceFrame`
- `referenceFrame` {{optional_inline}}
- : The local coordinate system representing
the reference frame. It can be either `'device'` or
`'screen'`. The default is `'device'`.
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gravitysensor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page-type: web-api-interface
browser-compat: api.GravitySensor
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`GravitySensor`** interface of the [Sensor APIs](/en-US/docs/Web/API/Sensor_APIs) provides on each reading the gravity applied to the device along all three axes.

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/gyroscope/gyroscope/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-constructor
browser-compat: api.Gyroscope.Gyroscope
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`Gyroscope()`** constructor
creates a new {{domxref("Gyroscope")}} object which provides on each reading the
Expand All @@ -25,13 +25,13 @@ new Gyroscope(options)

- : Options are as follows:

- `frequency`
- `frequency` {{optional_inline}}
- : The desired number of times per second a sample should
be taken, meaning the number of times per second that the
{{domxref('sensor.reading_event', 'reading')}} event will be called. A whole number or decimal may be
used, the latter for frequencies less than a second. The actual reading frequency
depends device hardware and consequently may be less than requested.
- `referenceFrame`
- `referenceFrame` {{optional_inline}}
- : Either `'device'` or
`'screen'`. The default is `'device'`.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gyroscope/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page-type: web-api-interface
browser-compat: api.Gyroscope
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`Gyroscope`** interface of the [Sensor APIs](/en-US/docs/Web/API/Sensor_APIs) provides on each reading the angular velocity of the device along all three axes.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gyroscope/x/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-instance-property
browser-compat: api.Gyroscope.x
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`x`** read-only property of the
{{domxref("Gyroscope")}} interface returns a number specifying the
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gyroscope/y/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-instance-property
browser-compat: api.Gyroscope.y
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`y`** read-only property of the {{domxref("Gyroscope")}} interface returns a number specifying the angular velocity of the device along its y-axis.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gyroscope/z/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-instance-property
browser-compat: api.Gyroscope.z
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`z`** read-only property of the
{{domxref("Gyroscope")}} interface returns a number specifying the
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/linearaccelerationsensor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page-type: web-api-interface
browser-compat: api.LinearAccelerationSensor
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`LinearAccelerationSensor`** interface of the [Sensor APIs](/en-US/docs/Web/API/Sensor_APIs) provides on each reading the acceleration applied to the device along all three axes, but without the contribution of gravity.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-constructor
browser-compat: api.LinearAccelerationSensor.LinearAccelerationSensor
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`LinearAccelerationSensor()`**
constructor creates a new {{domxref("LinearAccelerationSensor")}} object which
Expand All @@ -26,13 +26,13 @@ new LinearAccelerationSensor(options)

- : Options are as follows:

- `frequency`
- `frequency` {{optional_inline}}
- : The desired number of times per second a sample should
be taken, meaning the number of times per second that the
{{domxref('sensor.reading_event', 'reading')}} event will be called. A whole number or decimal may be
used, the latter for frequencies less than a second. The actual reading frequency
depends on device hardware and consequently may be less than requested.
- `referenceFrame`
- `referenceFrame` {{optional_inline}}
- : Either `'device'` or
`'screen'`. The default is `'device'`.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/magnetometer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ status:
browser-compat: api.Magnetometer
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`Magnetometer`** interface of the [Sensor APIs](/en-US/docs/Web/API/Sensor_APIs) provides information about the magnetic field as detected by the device's primary magnetometer sensor.

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/magnetometer/magnetometer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status:
browser-compat: api.Magnetometer.Magnetometer
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`Magnetometer()`** constructor
creates a new {{domxref("Magnetometer")}} object which returns information about the
Expand All @@ -27,13 +27,13 @@ new Magnetometer(options)

- : Options are as follows:

- `frequency`
- `frequency` {{optional_inline}}
- : The desired number of times per second a sample should
be taken, meaning the number of times per second that the
{{domxref('sensor.reading_event', 'reading')}} event will be called. A whole number or decimal may be
used, the latter for frequencies less than a second. The actual reading frequency
depends on device hardware and consequently may be less than requested.
- `referenceFrame`
- `referenceFrame` {{optional_inline}}
- : Either `'device'` or
`'screen'`. The default is `'device'`.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/magnetometer/x/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status:
browser-compat: api.Magnetometer.x
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`x`** read-only property of the
{{domxref("Magnetometer")}} interface returns a number specifying
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/magnetometer/y/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status:
browser-compat: api.Magnetometer.y
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`y`** read-only property of the
{{domxref("Magnetometer")}} interface returns a number specifying
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/magnetometer/z/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status:
browser-compat: api.Magnetometer.z
---

{{APIRef("Sensor API")}}{{SeeCompatTable}}
{{securecontext_header}}{{APIRef("Sensor API")}}{{SeeCompatTable}}

The **`z`** read-only property of the
{{domxref("Magnetometer")}} interface returns a number specifying
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/orientationsensor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page-type: web-api-interface
browser-compat: api.OrientationSensor
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`OrientationSensor`** interface of the [Sensor APIs](/en-US/docs/Web/API/Sensor_APIs) is the base class for orientation sensors. This interface cannot be used directly. Instead it provides properties and methods accessed by interfaces that inherit from it.

Expand All @@ -22,7 +22,7 @@ Below is a list of interfaces based on the OrientationSensor interface.

## Instance properties

- {{domxref("OrientationSensor.quaternion")}}
- {{domxref("OrientationSensor.quaternion")}} {{ReadOnlyInline}}
- : Returns a four element {{jsxref('Array')}} whose elements contain the components of the unit quaternion representing the device's orientation.

## Instance methods
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/orientationsensor/populatematrix/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ page-type: web-api-instance-method
browser-compat: api.OrientationSensor.populateMatrix
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`populateMatrix`** method of the
The **`populateMatrix()`** method of the
{{domxref("OrientationSensor")}} interface populates the given target matrix with the
rotation matrix based on the latest sensor reading. The rotation matrix is shown
below.
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/orientationsensor/quaternion/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-instance-property
browser-compat: api.OrientationSensor.quaternion
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`quaternion`** read-only
property of the {{domxref("OrientationSensor")}} interface returns a four element
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/relativeorientationsensor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page-type: web-api-interface
browser-compat: api.RelativeOrientationSensor
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`RelativeOrientationSensor`** interface of the [Sensor APIs](/en-US/docs/Web/API/Sensor_APIs) describes the device's physical orientation without regard to the Earth's reference coordinate system.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-constructor
browser-compat: api.RelativeOrientationSensor.RelativeOrientationSensor
---

{{APIRef("Sensor API")}}
{{securecontext_header}}{{APIRef("Sensor API")}}

The **`RelativeOrientationSensor()`**
constructor creates a new {{domxref("RelativeOrientationSensor")}} object which
Expand All @@ -25,14 +25,14 @@ new RelativeOrientationSensor(options)

- : Options are as follows:

- `frequency`
- `frequency` {{optional_inline}}
- : The desired number of times per second a sample
should be taken, meaning the number of times per second that the
{{domxref('sensor.reading_event', 'reading')}} event will be called. A whole number or decimal
may be used, the latter for frequencies less than a second. The actual
reading frequency depends device hardware and consequently may be less
than requested.
- `referenceFrame`
- `referenceFrame` {{optional_inline}}
- : Either `'device'` or
`'screen'`. The default is `'device'`.

Expand Down
Loading

0 comments on commit 4ea748e

Please sign in to comment.