Monday, May 20, 2024
18
rated 0 times [  21] [ 3]  / answers: 1 / hits: 107668  / 14 Years ago, wed, may 26, 2010, 12:00:00

Is it possible to determine if Google Chrome is in incognito mode via a script?



Edit: I actually meant is it possible via user-script, but the answers assume JavaScript is running on a web page. I've re-asked the question here in regards to user scripts.


More From » google-chrome

 Answers
34

The functionality of this answer is Chrome version dependant. The most recent comment was this works in v90


Yes. The FileSystem API is disabled in incognito mode. Check out https://jsfiddle.net/w49x9f1a/ when you are and aren't in incognito mode.


Sample code:




    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));
}




[#96684] Saturday, May 22, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kourtney

Total Points: 368
Total Questions: 103
Total Answers: 85

Location: Bonaire
Member since Sat, May 1, 2021
3 Years ago
kourtney questions
Sun, Oct 4, 20, 00:00, 4 Years ago
Tue, Oct 29, 19, 00:00, 5 Years ago
Thu, Apr 4, 19, 00:00, 5 Years ago
Fri, Mar 1, 19, 00:00, 5 Years ago
;