I know how to get user's position with JavaScript. I also know how to check if permission has been granted or not:
(async () => {
const permission = await navigator.permissions.query({
name: 'geolocation',
});
console.log(permission.state);
permission.addEventListener(
'change',
event => console.log(event.target.state)
);
})();
But is it possible to ask for permission without getting location? Sure, I can just call navigator.geolocation.getCurrentPosition(success) and dismiss it, but is there an explicit way to only ask for permission?