The value property provides the current level of the ambient light.


var light = instanceOfDeviceLightEvent.value;


A positive number representing a light intensity expressed in lux.


Specification Status Comment
Ambient Light Sensor
The definition of 'Ambient Light Events' in that specification.
Candidate Recommendation Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No Yes

621 2

22 — 613

No No No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No No Yes

621 2

15 — 61

No No ?

1. See bug 1462308.

2. From version 62: this feature is behind the device.sensors.ambientLight.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

3. Not supported for macbook with touchbar and Windows 7.

See also

Document Tags and Contributors

Last updated by: connorshea,