javascript - Make html5 geolocation ask permission every time user reloads the page -


why need that:

we have page in our website allows users enter data , search customers in area. when user opened page popup message must shown

http://foo.bar.com use current location.

after user can discard , fill location fields manually or accept , automatically redirected results page.

problem:

the problem when user selects of mentioned options @ first time, browser remembers , don't ask next time. when user accept it, every time open search page automatically redirect him results page withous asking anything.

code:

we using basic html5 geolocation code

if (navigator.geolocation) {    navigator.geolocation.getcurrentposition(locationmethod); }  

conclusion:

i'm pretty sure it's impossible change permission browser-native. hope give nice solution problem. thanks.

once user clicks deny/allow browser remembers decision site.

the best way avoid deny call getcurrentposition(...) when user clicked means wants use location. , glad share :)

a example on foursquare site. on entering offers go map city, , there clicking button on map of "use location" prompts it.

if denied location show info message "you have denied location service in past site, enable bla bla bla". , fill in bla bla bla whatever.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -