incognito
Type | String |
---|---|
Mandatory | No |
Manifest version | 2 or higher |
Example |
json
json
json
|
Use the incognito
key to control how the extension works with private browsing windows.
Note:
By default, extensions do not run in private browsing windows. Whether an extension can access private browsing windows is under user control. For details, see Extensions in Private Browsing. Your extension can check whether it can access private browsing windows using extension.isAllowedIncognitoAccess
.
This is a string that can take any of these values:
-
"spanning" (the default): the extension sees events from private and non-private windows and tabs. Windows and tabs gets an
incognito
property in theWindow
orTab
that represents them. This property indicates whether or not the object is private:jsbrowser.windows.getLastFocused().then((windowInfo) => { console.log(`Window is private: ${windowInfo.incognito}`); });
-
"split": the extension is split between private and non-private windows. There are effectively two copies of the extension running: one sees only non-private windows, the other sees only private windows. Each copy has isolated access to Web APIs (so, for example,
localStorage
is not shared). However, the WebExtension APIstorage.local
is shared.Note: Firefox doesn't support "split" mode. Extensions that request this option in Firefox are installed using "not_allowed".
-
"not_allowed": private tabs and windows are invisible to the extension.
Example
"incognito": "spanning"
"incognito": "split"
"incognito": "not_allowed"
Browser compatibility
BCD tables only load in the browser