efeozkesici
efeozkesici

Reputation: 575

Is there any way to check browser works with incognito mode or not by using javascript?

I want to check browser mode by using Javascript. I found this link, but it doesn't work for new version of Chrome. Is there any new way to check this?

Upvotes: 5

Views: 6468

Answers (1)

Joe Rutkowski
Joe Rutkowski

Reputation: 296

This is an old question, but to answer it: yes, you can still detect incognito in Chromium-based browsers. The gist is you call navigator.storage.estimate() and compare the quota property to performance.memory.jsHeapSizeLimit. If the quota is less than jsHeapSizeLimit, it's incognito.

I have a script that you can take a look at.

https://github.com/Joe12387/detectIncognito

Upvotes: 7

Related Questions