我有一个具有权限设置的 chrome 应用程序,其中之一是地理位置。它有一个沙箱 index.html 我想从那个 index.html 获取用户位置。有什么方法可以从该页面获取地理位置。
function success(position){
}
function error(){
console.log('unable to track user location now')
}
var id = navigator.geolocation.watchPosition(success, error, options);
给出错误用户拒绝的位置。我没有看到弹出这个页面是请求地理定位许可