Created
October 19, 2021 14:13
-
-
Save RemcoSmitsDev/f6c5b91f9616248fbe04aa98b6d7980b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function isInCognito() { | |
const fs = window.RequestFileSystem || window.webkitRequestFileSystem; | |
if (!fs) { | |
return false; | |
} | |
let isInCognito = false; | |
await fs( | |
window.TEMPORARY, | |
100, | |
function(fs) { | |
isInCognito = false; | |
}, | |
function(err) { | |
isInCognito = true; | |
} | |
); | |
return isInCognito; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment