2

You can easily request a permission with browser.permissions.request and the user can accept or decline it.

Now the browser extension's UI (e.g. popup or options page) stays visible and usable for the user, however. Which leads to an UX problem.

Because if you notice another user interaction, which e.g. invalidates the original reason you had to request the permission from the user; you may want to cancel/decline the permission request by yourself, as a developer.

Otherwise users have already declined/reverted what caused the permission request, but still have this annoying popup. If the user accepts it, they have accepted a permission they don't need; if they decline, they had at least two clicks to do.


Cross-posted to Mozilla Discourse.

rugk
  • 4,755
  • 2
  • 28
  • 55
  • There's nothing in the documentation and this UI is a built-in browser dialog so extensions can't control it. All you can do is disable the popup altogether using browserAction.setPopup with an empty string or change the popup contents to "please confirm the request" when the request is displayed. – wOxxOm Sep 06 '19 at 10:10

0 Answers0