It's fascinating to see the adversarial relationship between the developers of Incognito Mode and those trying to detect it. JS is a very rich environment with a ton of options. https://www.bleepingcomputer.com/news/google/google-chrome-incognito-mode-can-still-be-detected-by-these-methods/