This translation is incomplete. Please help translate this article from English.
これは実験段階の機能です。
この機能は複数のブラウザで開発中の状態にあります。各ブラウザで用いるために、適切なベンダー接頭辞が必要な場合があります。互換性テーブルをチェックしてください。また、実験段階の機能の構文と挙動は、仕様変更に伴い各ブラウザの将来のバージョンで変更になる可能性があることに注意してください。
The DeviceLightEvent provides web developers with information from photo sensors or similiar detectors about ambient light levels near the device. For example this may be useful to adjust the screen's brightness based on the current ambient light level in order to save energy or provide better readability.
Properties
DeviceLightEvent.value- The level of the ambient light in lux.
Example
window.addEventListener('devicelight', function(event) {
console.log(event.value);
});
Specifications
| Specification | Status | Comment |
|---|---|---|
| Ambient Light Events The definition of 'Ambient Light Events' in that specification. |
勧告候補 | Initial specification |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 未サポート | 22.0 (22.0) (Mac OS X only) | 未サポート | 未サポート | 未サポート |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | 未サポート | 未サポート | 15.0 (15.0) | 未サポート | 未サポート | 未サポート |
Gecko-specific notes
The devicelight event is implemented and preference enabled by default in Firefox Mobile for Android (15.0) and in Firefox OS (B2G). Starting with Gecko 22.0 (Firefox 22.0 / Thunderbird 22.0 / SeaMonkey 2.19) a desktop implementation for Mac OS X is also available. Support for Windows 7 is in progress (see バグ 754199).