Skip to content

Request browser wake lock when location is being tracked#997

Merged
hiddewie merged 3 commits into
masterfrom
location-keep-awake
Jun 14, 2026
Merged

Request browser wake lock when location is being tracked#997
hiddewie merged 3 commits into
masterfrom
location-keep-awake

Conversation

@hiddewie

@hiddewie hiddewie commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Fixes #967

If the user has enabled location tracking, the UI will request the browser to disable sleep.

See https://developer.chrome.com/docs/capabilities/web-apis/wake-lock
See https://stackoverflow.com/questions/6106747/can-i-prevent-phone-from-sleep-on-a-webpage
See https://w3c.github.io/screen-wake-lock/
See https://maplibre.org/maplibre-gl-js/docs/API/classes/GeolocateControl/

Semantics:

  • By default does not do anything
  • When the user requests location tracking, the browser wake lock is enabled
  • When the user stops location tracking, the browser wake lock is disabled
  • When the user is using location tracking, but moves the map, the wake lock is disabled until the user re-enables full location tracking

@hiddewie hiddewie mentioned this pull request Jun 13, 2026
@hiddewie hiddewie changed the title Location keep awake Request browser wake lock when location is being tracked Jun 13, 2026
@hiddewie hiddewie marked this pull request as ready for review June 13, 2026 18:25
@hiddewie hiddewie merged commit 9924416 into master Jun 14, 2026
3 checks passed
@hiddewie hiddewie deleted the location-keep-awake branch June 14, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wake lock on tracking

1 participant