Domanda

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.

È stato utile?

Soluzione

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

chrome.extension.isAllowedIncognitoAccess(function(/*boolean*/ isAllowedAccess) {
    // ...
});
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top