0

I had an webapp that uses Geolocation, but, when url has ip, the Geolocation doesn't work.

I catch this error: PositionError {code: 1, message: "Only secure origins are allowed ...

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
  • 2
    Secure origins are probably only your local machine and HTTPS hosts – aJetHorn Jan 23 '18 at 00:41
  • 2
    https://developers.google.com/web/updates/2016/04/geolocation-on-secure-contexts-only – Ricky Ruiz Jan 23 '18 at 00:52
  • @Ricky - You should just post that as an answer, with a summary, something along the lines of "You need to enable a HTTPS\secure connection with your webapp." – Puddler Jan 23 '18 at 00:56

1 Answers1

1

Chrome no longer supports obtaining the user's location using the HTML5 Geolocation API from pages delivered by non-secure connections.

User location is considered sensitive data, that's why Chrome enforced serving your website in a secure context (HTTPS) in order to use the Geolocation API in their browser.

More info: https://developers.google.com/web/updates/2016/04/geolocation-on-secure-contexts-only

Ricky Ruiz
  • 25,455
  • 6
  • 44
  • 53