Geofencing

The Geofencing API allow authorized web applications to define geographic areas and receive notifications when the device enters or leaves these areas without the need to periodically query the Geolocation API. Thanks to the Service Worker being employed that allows code execution outside of the lifecycle of the owning web application, the notification may be also received while the app is not opened in the browser.

As of August 2016, no vendor implemented the API and the proposal seems to be abandoned.

API glimpse

region = new CircularGeofenceRegion({name, latitude, longitude, radius})
Creates a circular region definition with the coordinates and radius specified.
serviceWorkerRegistration.geofencing.add(region, options)
Sets up a region to be watched for and subscribes to the notification when the device enters or leaves the region.
self.addEventListener('geofenceenter', listener)
An event fired when the device enters one of the defined regions, provided as event.geofence.region.
self.addEventListener('geofenceleave', listener)
An event fired when the device leaves one of the defined regions, provided as event.geofence.region.

Resources