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 Stackoverflow.