Skip to main content
This topic has been closed for replies.

2 replies

WolfShade
Legend
August 21, 2018

Companies that make browsers make incognito modes better every time someone figures a way to detect incognito mode.  It's a vicious circle, one that will keep you researching the newest hack every time they thwart your desire to detect incognito mode.

Why bother?

V/r,

^ _ ^

Community Expert
August 21, 2018

What are you hoping to accomplish? There might be another way to test what you want to test or protect your site if we better understand your situation.

If you wanted to detect Chrome, you could use this to detect the FileSystemAPI which is disabled in incognito mode and use that. If you are trying to go after a particular browser instead of an OS that could help us too because the ways to detect at times could be browser specific and not OS specific:

var fs = window.RequestFileSystem || window.webkitRequestFileSystem;

if (!fs) {

  console.log("check failed?");

} else {

  fs(window.TEMPORARY,

     100,

     console.log.bind(console, "not in incognito mode"),

     console.log.bind(console, "incognito mode"));

}

Participant
August 21, 2018

Thanks Ben,

What I am working on is firing a lightbox modal when a user is browsing incognito mode. The script I am using works in all browsers on PC. Chrome, Firefox, Edge etc. Just not on a Mac or iphone. I will give your script a shot. I will let you know shortly the outcome. WolfShade

As you can see it works here

Testing Incognito Browser Recognition - Articles - Bucks County Courier Times - Levittown, PA

(Modal shows when incognito, might need to refresh on icognito mode to see result). On PC browsers only.

WolfShade
Legend
August 21, 2018

Yes, it might work now.  But how long until a browser update breaks it?

V/r,

^ _ ^