Skip to content

Instantly share code, notes, and snippets.

@RemcoSmitsDev
Created October 19, 2021 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RemcoSmitsDev/f6c5b91f9616248fbe04aa98b6d7980b to your computer and use it in GitHub Desktop.
Save RemcoSmitsDev/f6c5b91f9616248fbe04aa98b6d7980b to your computer and use it in GitHub Desktop.
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