Permission popup opens behind a browser_action HTML popup

I have a browser_action popup that opens an HTML page (the same as my options_ui), and some of the checkboxes on the page will request permissions when ticked. This works fine in the regular options_ui page, but when the page is opened as a browser_action popup, the permissions popup is on a layer behind the HTML page so the it has to be dismissed before the permission can be granted. This causes a problem because I have the browser.permissions.request wait to return true before saving the settings.

I would assume the permission popup should always display on top of everything else.
Is there anyway to force the permission popup to be above the browser_action popup?

1 Like

Make sure to vote for the bug here :slight_smile:


My workaround was to close() the popup after requesting permission:

1 Like

Voted! A little sad that this was reported nearly year ago and is still a problem.

I’ve made a little workaround which should work for now. I have it so now it saves the setting to storage before requesting the permission, and also added a indicator and button to request permission if the setting is enabled but the permission is not granted (ie if they denied it after closing the browser_action popup). And if using the regular options UI page, it will untick the checkbox and save to storage again if the permission is denied.

Obviously having the permission popup on top would still be preferred, but this will at least work well enough for now.