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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Basic support | Chrome No support No | Edge ? | Firefox No support ? — 60 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Edge Mobile ? | Firefox Android Full support 15 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android ? |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown