Hide Incognito Mode - a browser extension


How it Works - (deep technical stuff for programmers)

Websites use at least 2 different methods to detect incognito mode, and this extension attempts to thwart their efforts.

Incognito detection method #1

Chrome / Webkit does not allow the window.RequestFileSystem / window.webkitRequestFileSystem API to operate properly in incognito mode, and many websites use this fact as a way to detect if you're using incognito mode. Specifically, websites just try to create a temporary file using the API and then monitor whether the success or error callback gets called. To prevent them from detecting you this extension will install a shim to overwrite the native implementation of window.RequestFileSystem with new code that will always call the success callback - effectively fooling the website into thinking that the API is functional, which implies you're not incognito. The shim doesn't actually attempt to emulate the API and allow writing to the filesystem - it just calls the success callback, and that's it. It's very unlikely, but it may break some websites which legitimately try to use the filesystem API while you're using incognito mode. While the API doesn't even work in incognito mode, it's possible the web page has an obscure dependency on some part of the API's behavior that may get modified by the shim. But again, it's unlikely.

Incognito detection method #2

Recently (since Chrome 74) websites started using a different detection method which looks at the disk storage quota returned by StorageManager.estimate(). The value is capped by the browser at 120MB when running in incognito, but when not incognito, there is no such cap. So websites look for that specific limit to detect incognito. Chrome may change this in the future so that the quota doesn't differ in incognito, closing this incognito detection loophole that websites currently exploit. But for now we patch it by installing a shim for StorageManager.estimate() aka navigator.storage.estimate(). The shim will modify the StorageEstimate object returned, faking the quota to say that it is 120MB + 1 more byte. Adding just 1 more byte should be enough to fool them, while minimizing the chance of incompatibilities caused by making the client think they have more disk space than they really do.