Search code examples
javascriptgoogle-chrome-extensionincognito-mode

Get time when Chrome extension's "Allow in incognito" is turned on\off


I need to get the time when my Chrome extension's "Allow in incognito" mode is turned on\off.

I know about chrome.extension.isAllowedIncognitoAccess(). But I would need to check each few seconds with this function. Is there any more ellegant way, like some event listener?

I also tried inserting content script into chrome://extensions page and registering each time someone checks\unchecks that chechbox for allowing in incognito, but it's not allowed to inject scripts into this page.


Solution

  • Sadly, no.

    There isn't any event that would fire when this permission is changed - neither in chrome.extension API, nor in chrome.management API (in fact, this permission is not exposed to management API at all).