0

How can I detect private browsing FireFox on javascript?


Firefox ver. 29.0.1

Checking indexedDB in try...catch dont' work :(

http://jsfiddle.net/ejmcLuar/

    var dbTest;
    try{    
        dbTest =  window.indexedDB.open('test');
        console.log('Incognito NOT detected')
    } catch(e){
        console.log('Incognito detected')
    }
LWC
  • 1,084
  • 1
  • 10
  • 28
Geray Suinov
  • 3,521
  • 3
  • 16
  • 19
  • 1
    you can't reliably tell the difference between a first-time visitor and a regular in private mode, but there may be some supporting clues; lack of cookies, lack of referrer, ajax timing differences, etc. none of those mean private mode, but they can prove non-private mode. – dandavis May 26 '14 at 16:00
  • 2
    You can use: var dbTest = window.indexedDB.open('test'); dbTest.onerror = function() { isPrivateModeFF= true; } But it will be asynchronous. – Olivier Jul 03 '14 at 15:44

1 Answers1

1

The answer to your question is simple: There is no sure way to detect if a user is private browsing or not.

sjkm
  • 3,887
  • 2
  • 25
  • 43