3

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?

efeozkesici
  • 455
  • 1
  • 7
  • 14

1 Answers1

3

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

Joe Rutkowski
  • 171
  • 1
  • 3
  • 6
  • Hello Joe, I just checked your code and works very well on the latest chrome version where I am currently working on. Thank you for your work it is very complete. – Es Noguera Jan 19 '22 at 15:16