Skip to content

WeiminWangKolmostar/position

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get Geolocation from Web Browser

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.

Usage

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.