josesigna
josesigna

Reputation: 488

Determine if Internet Explorer is in private browsing mode from extension

Is it possible to detect private browsing mode on Internet Explorer using Forge Trigger.IO's framework from an extension?

EDIT

I am looking for something similar to Firefox's nsIPrivateBrowsingService or to Chrome's chrome.tabs API's incognito check.

Upvotes: 1

Views: 1041

Answers (3)

josesigna
josesigna

Reputation: 488

Conclusion

  • Extensions indeed can run on inPrivate Mode if the option (OFF by default) to enable extensions inPrivate Mode is ON.

  • There is no way of getting this information using Trigger.IO's framework at this moment.

Upvotes: 0

Antoine van Gelder
Antoine van Gelder

Reputation: 786

Internet Explorer disables all browser extensions when entering private browsing mode which means that:

  1. Your extension never runs on tabs in private browsing mode.
  2. Instances of your extension running in other tabs are neither aware of nor can they interact with pages in private browsing mode.

The unfortunate result of this decision by Microsoft is that even if you had a method of detecting incognito status on a window [1] you wouldn't be able to do anything with that information!

[1] e.g. Writing a BHO that enumerates all desktop windows and checks for the string "InPrivate" in their titles.

Upvotes: 1

Kris Krause
Kris Krause

Reputation: 7326

Couldn't you just attempt to place a cookie (or write to local storage)? If the cookie (and data) does not exist... then private mode is on?

Upvotes: 1

Related Questions