Since the navigator.geolocation.getCurrentPosition()
api of web browser is available only in secure contexts (HTTPS), this repo provides the geolocation accessing service which can be used on non-HTTPS web app.
In your non-HTTPS web app, when you need to get the geolocation of user:
window.open("https://weiminwangkolmostar.github.io/position/")
In the new window, the page will write the geolocation of user to users' clipboard and close the window after success.