Skip to content

Helper module to interactively request permission from the user on a static page.

Notifications You must be signed in to change notification settings

TinyWebEx/PermissionRequest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

PermissionRequest

Helper module to interactively request permission from the user on a static page.

It uses the message handler module to guide the user with message boxes to confirm a requested permission.

Usage

  1. Register one or more message boxes for a permission with registerPermissionMessageBox.
  2. Show the permission with requestPermission.

Afterwards, it handles the permission box and permission request dialog by itself. However, you can still cancel it (with some caveats with cancelPermissionPrompt) and check the current status with isPermissionGranted.

Reaction

requestPermission returns a promise. In contrast to the original browser.permissions.request API, the promise only resolves if the user accepted the permission request. Otherwise it just rejects with an PermissionError.

About

Helper module to interactively request permission from the user on a static page.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published