3 ms·
By default in Firefox, indexedDB is disabled in private browsing mode (dom.indexedDB.privateBrowsing.enabled=false in about:flags), so you can detect it with so
by jffry 6y ago
By default in Firefox, indexedDB is disabled in private browsing mode (dom.indexedDB.privateBrowsing.enabled=false in about:flags), so you can detect it with something like
var db = indexedDB.open("test");
db.onerror = () => console.log('private browsing');
db.onsuccess = () => console.log('not private browsing');
Based on Bugzilla, it seems like currently the backing mechanism for implementing indexedDB will write origin names to disk which is not something they want Private Browsing to do. See this older bug https://bugzilla.mozilla.org/show_bug.cgi?id=781982 https://bugzilla.mozilla.org/show_bug.cgi?id=781982 and this newer one https://bugzilla.mozilla.org/show_bug.cgi?id=1639542 https://bugzilla.mozilla.org/show_bug.cgi?id=1639542