w3c / webextensions

Charter and administrivia for the WebExtensions Community Group (WECG)
Other
592 stars 54 forks source link

Proposal: API to allow incognito access #658

Open erosman opened 1 month ago

erosman commented 1 month ago

Background

Some APIs, like proxy.settings, require incognito permission.

While extensions can enquire extension.isAllowedIncognitoAccess, currently, there is no API for the extension to handle the user option within the extension environment. Extensions are forced to ask users to go to the appropriate browser page in order to allow incognito access.

Proposal

Add an API to enable extensions to requests incognito access from the users (similar to permissions.request())

For example:

// via permissions.request
let permission = await browser.permissions.request({permissions: ['incognito']});
// return true/false

// via own API
let incognito = await browser.extension.requestIncognitoAccess();
// return true/false

See also:

Rob--W commented 1 month ago

FYI: starting from Firefox 129, the ability to access private browsing windows is part of the install dialog (https://bugzilla.mozilla.org/show_bug.cgi?id=1842832). Up until Firefox 128, there was a post-install panel from which users can easily grant access to private browsing mode.

After install, it is not obvious for users that their extension is unavailable in private browsing windows.