Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 665 Bytes

permissions.md

File metadata and controls

31 lines (22 loc) · 665 Bytes

permissions

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.

Usage

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.

Options

N/A