permissions
allows you to observe the state of a given browser permission.
For example, you may wish to observe the state of the geolocation
permission
and know when it becomes granted
.
class MyElement extends LitElement {
constructor() {
super();
this._permissionsCtrl = new PermissionsController(this, 'geolocation');
}
render() {
return html`
Geolocation permission is ${this._permissionsCtrl.state}
`;
}
}
The required argument is a permission name which varies across browsers in some cases.
N/A