I'm having a problem with javascript's:
navigator.geolocation.getCurrentPosition(success_callback,error_callback)
It's working fine on most machines with most browsers..problem is I have a Mac and by default it prevents browsers accessing locations, unless I manually allow it at the OS level. (As a side note I'm using the Brave browser, chrome doesn't have the issue)
What is happening at the moment is that Brave asks for permission to access location. I select yes but because at the OS level it isn't permitted, the success_callback and the error_callback are both not called...thus my site just hangs there.
I should mention, chrome doesn't have this issue, it somehow knows the os is blocking the permission so the error_callback gets called.
My question is how do I over come this? Partial code is below:
<template>
<Modal v-if="showModal">
</template>
navigator.geolocation.getCurrentPosition(this.setBrowserLocation, this.errorBrowserLocation)
setBrowserLocation(position) {
....
....
....
this.showModal = true
}
errorBrowserLocation(error) {
this.showModal = true
}
I'm thinking that I can do something along the lines of checking if neither one of the call_backs is called. And if they are both not called I can auto set this.showModal. I thought of using watchers but they only detect a change...so nothing changes then I can't really use it.
Any ideas of how I can deal with this?