Question

I am working on a Chrome Extension and would like the extension to be able to periodically check if it has permission (via the check box on the chrome://extensions page) to run in incognito mode. Is there anyway of doing this?

Obviously, I could just monitor for new windows and if it is an incognito window then I know that it has permission. However this method wouldn't tell me explicitly if I don't have permission. Another possibility is to have it actually create new incognito windows periodically and check if it has access to them, but that can get annoying for the user.

Was it helpful?

Solution

There's an existing function for it: chrome.extension.isAllowedIncognitoAccess:

chrome.extension.isAllowedIncognitoAccess(function(/*boolean*/ isAllowedAccess) {
    // ...
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top