Closed Bug 1811693 Opened 2 years ago Closed 2 years ago

[Add-ons] when popup is opened on install, the incognito permission prompt blocks it

Categories

(WebExtensions :: General, defect)

Firefox 111
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1558336

People

(Reporter: oaeben, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0

Steps to reproduce:

Have the following code in background-script.js :

browser.runtime.onInstalled.addListener(({ reason }) => {
    if (reason === 'install') {
        browserbrowserAction.openPopup();
    }
});

Actual results:

The popup is opened on install, but the incognito permission prompt is displayed on top of it.

Accepting/Dismissing the incognito prompt also closes the popup beneath it

Expected results:

Either browser.runtime.onInstalled should happen after that prompt, or provide some other way to deal with the situation.

I'd like to also note that the reason that I would like my popup to open on install, is because in Manifest V3 there isn't automatic permission prompt anymore (permissions are optional)

So the only way to make sure that users accept the permissions required for my extension to work, is to prompt for permissions on install myself.

I've also tried another way, opening a new tab with the popup.html instead of the popup itself.

browserApi.runtime.onInstalled.addListener(({ reason }) => {
    if (reason === 'install') {
        browserApi.tabs.create({ url: browserApi.runtime.getURL('popup/popup.html') });
    }
});

It seems to behave similarly, the tab is opened, and the incognito permission prompt is displayed at the top right of the screen.
Clicking the incognito prompt closes the tab immediately.

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Product: Firefox → WebExtensions

I'm pretty sure this happens because selecting "Allow this extension to run in Private Windows" restarts the extension.

Component: Untriaged → General

Thanks Alexi!

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1558336
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.