files/en-us/web/api/permissionstatus/index.md
{{APIRef("Permissions API")}}{{AvailableInWorkers}}
The PermissionStatus interface of the Permissions API provides the state of an object and an event handler for monitoring changes to said state.
{{InheritanceDiagram}}
name passed to {{domxref("Permissions.query")}}.'granted', 'denied', or 'prompt'.PermissionStatus.state.navigator.permissions
.query({ name: "geolocation" })
.then((permissionStatus) => {
console.log(`geolocation permission status is ${permissionStatus.state}`);
permissionStatus.onchange = () => {
console.log(
`geolocation permission status has changed to ${permissionStatus.state}`,
);
};
});
{{Specifications}}
{{Compat}}