Re: [geolocation-sensor] Support geolocation (especially geofencing) in the "background" (#22)

Thanks folks for you continued feedback. As I'm preparing for the group's next F2F where we will review the new use cases your submitted, I asked Claude to summarize this issue that now has in total 73 comments from the broader community. Provided below.

<details>
<summary>Summary</summary>

Disclaimer: The quoted summary below is AI generated, so it can contain errors. I already see Claude missed some important nuances that I had captured in my mental model while reading through every comment you had submitted. Folks interested in this topic should dig into the comments proper.

> ## Use Cases
> 
> The main use cases discussed for background geolocation support include:
> 
> 1. **Geofencing Applications**: Triggering events when a user enters or exits specific geographic areas while the app is in the background
> 
> 2. **Activity Tracking**: Background geotracking for fitness and sports applications such as:
>    - Cyclocomputers
>    - Running trackers  
>    - Skiing trackers
>    - Hiking trackers
> 
> 3. **PWA Parity**: Enabling Progressive Web Apps (PWAs) to have the same background geolocation capabilities as native mobile applications
> 
> 4. **Continuous Location Monitoring**: Background geotracking that continuously monitors location changes without requiring the app to be in the foreground
> 
> ## Proposed Solutions
> 
> Several technical solutions were suggested in the discussion:
> 
> 1. **ExtendableEvent Integration**: Using the Service Worker extensibility mechanism by extending `ExtendableEvent` to create custom geolocation events:
>    ```javascript
>    interface GeoChangeEvent : ExtendableEvent {
>      // add custom properties and methods
>    }
>    ```
> 
> 2. **Wake Lock API Integration**: Initially suggested using the Wake Lock API for background geolocation, though this approach was later deemed less suitable for geofencing specifically
> 
> 3. **Separate APIs for Different Use Cases**:
>    - **Geofencing API**: Specifically for geographic boundary detection (preferred approach)
>    - **Background Geotracking API**: For continuous location monitoring (requires more privacy considerations)
> 
> 4. **Polyfill for Foreground Testing**: A `geolocation-sensor.js` polyfill was created to test foreground API ergonomics while background functionality is being developed
> 
> ## Key Considerations
> 
> The discussion highlighted several important considerations:
> 
> - **Privacy**: Background geotracking requires significant privacy protections and user consent mechanisms
> - **Battery Consumption**: Need to balance functionality with device battery life
> - **User Control**: Users should be able to activate/deactivate background geolocation features
> - **Browser Vendor Comfort**: Solutions need to address privacy concerns to gain browser implementer support
> 
> The issue remains open and active, with ongoing work to define specifications and gather web developer feedback on API design.

</details>

-- 
GitHub Notification of comment by anssiko
Please view or discuss this issue at https://github.com/w3c/geolocation-sensor/issues/22#issuecomment-3492451283 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 5 November 2025 17:21:34 UTC