Jeevan
Jeevan

Reputation: 3938

How to detect incognito mode from extension background

I have specified "incognito" as "split" in my manifest file.

http://developer.chrome.com/extensions/manifest.html#incognito

So if the app or extension contains a background page, that will also run in the incognito process. This incognito process runs along side the regular process, but has a separate memory-only cookie store.

So how can I detect whether the background page is running in incognito process.

Upvotes: 15

Views: 4015

Answers (1)

Jeevan
Jeevan

Reputation: 3938

Found the solution.

You can check it using

chrome.extension.inIncognitoContext

http://developer.chrome.com/dev/extensions/extension.html#property-inIncognitoContext

Upvotes: 17

Related Questions