Chrome Extension Incognito Mode: Choosing a Manifest Value
Originally published on ExtensionLaunch. Chrome extension incognito mode trips up many developers: your extension works fine in normal windows, then seems to vanish in private ones. This article explains why that happen
Originally published on ExtensionLaunch.
Chrome extension incognito mode trips up many developers: your extension works fine in normal windows, then seems to vanish in private ones. This article explains why that happens, which manifest value to choose, and how to keep users' private browsing private.
The default: your extension does not run
By default, extensions don't run in incognito windows. The user has to switch on Allow in incognito for your extension on the extensions page. Your code cannot flip that switch for them.
So the first job is to expect that most private windows will run without your extension, and to handle that gracefully.
Pick one of three manifest values
The incognito key in your manifest controls how the extension behaves once a user has allowed it.
| Value | Behavior |
|---|---|
"spanning" |
The default. One shared process serves regular and incognito windows. |
"split" |
Incognito windows get their own process and cookie store. |
"not_allowed" |
The extension is blocked from incognito entirely. |
{
"incognito": "not_allowed"
}
If your extension must never see private browsing, use "not_allowed". Also note that Firefox does not support "split", so check your cross-browser plans before relying on it.
Detect access instead of failing silently
If your extension needs incognito access to work, ask Chrome whether it has it:
chrome.extension.isAllowedIncognitoAccess((allowed) => {
if (!allowed) {
// Show a short hint explaining how to enable "Allow in incognito"
}
});
A clear setup hint beats a silent failure. Users who turned the feature on deliberately will otherwise assume your extension is broken.
Respect the private window
Private browsing is a promise to the user. Keep these habits:
- Don't save browsing history from private tabs.
-
Remember that settings are shared. Data in
chrome.storageis shared across regular and incognito modes. -
Watch network requests in spanning mode. Requests from the background page can link private activity to a regular session, so the original guide recommends
credentials: "omit"for them.
Know what won't work
Some things are simply unavailable in private windows:
- Incognito windows can't override the New Tab page.
- In spanning mode, extension pages can't load in the main frame of an incognito tab.
- Users can't install extensions from incognito or guest mode.
Test both states
Run your extension with the incognito switch on and off. Check that the hint appears when access is off, that features degrade sensibly, and that your privacy policy and store listing describe what happens in private windows. Firefox and Edge use their own per-extension permission settings, so repeat the test there if you ship to those browsers.
Say it on your store listing
Because behavior differs between normal and private windows, tell users what to expect. State plainly whether your extension can run in incognito, whether they must enable Allow in incognito, and what data, if any, it touches there. Keeping the listing and your privacy policy consistent with the manifest value you chose prevents confusing reviews and support requests later.
Key takeaways
- Extensions don't run in incognito unless the user allows it, and code can't enable it.
- Choose
"spanning","split"or"not_allowed"deliberately. - Use
chrome.extension.isAllowedIncognitoAccess()to show a setup hint. - Don't save private browsing history, and keep background requests from linking sessions.
- Test with the switch on and off, and update your listing and privacy policy.
For the full checklist and FAQ, read the complete guide to Chrome extension incognito mode and the manifest key. If you are planning a launch, ExtensionLaunch's browser extension growth guides cover the rest of the journey.
Have you shipped an extension that needed incognito support? Which manifest value did you choose, and why?
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.