Window.ondeviceproximity

Specifies an event listener to receive deviceproximity events. These events occur when the device sensor detects that an object becomes closer to or farther from the device.

Syntax

window.onuserproximity = funcRef

Where funcRef is a function to be called when the deviceproximity event occurs. These events are of type DeviceProximityEvent.

Specifications

Specification Status Comment
Proximity Sensor
The definition of 'Proximity Events' in that specification.
Working Draft Initial specification

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome No support NoEdge ? Firefox No support ? — 60IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 15Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Contributors to this page: wbamberg, fscholz, teoli, cpigat, MHasan, kscarfone, Sheppy, Jeremie
Last updated by: wbamberg,