diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | web/js/geolocation.js | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index fed62f541..5a4c65d6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Remove unneeded 2x PNG fallback images. - Individual cobrands can disable social login #1890 - Improve performance of various pages, especially front. #1903 + - Don't show geolocation link on non-HTTPS pages. - Bugfixes - Shortlist menu item always remains a link #1855 - Fix encoded entities in RSS output. #1859 diff --git a/web/js/geolocation.js b/web/js/geolocation.js index 5ff9fe9dc..3c2cf04df 100644 --- a/web/js/geolocation.js +++ b/web/js/geolocation.js @@ -29,7 +29,8 @@ fixmystreet.geolocate = function(element, success_callback) { (function(){ var link = document.getElementById('geolocate_link'); if (!link) { return; } - if ('geolocation' in navigator) { + var https = window.location.protocol.toLowerCase() === 'https:'; + if ('geolocation' in navigator && https) { fixmystreet.geolocate(link, function(pos) { var latitude = pos.coords.latitude.toFixed(6); var longitude = pos.coords.longitude.toFixed(6); |