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.
Working Draft Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No Yes

601 2


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

601 2


No No ?

1. Disabled by default. See bug 1359076.

2. From version 60: 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,