Skip to content

Instantly share code, notes, and snippets.

@bishawjit-das
Created December 18, 2019 04:01
Show Gist options
  • Select an option

  • Save bishawjit-das/b41f85c03105879febc72d4eb9995d73 to your computer and use it in GitHub Desktop.

Select an option

Save bishawjit-das/b41f85c03105879febc72d4eb9995d73 to your computer and use it in GitHub Desktop.
<script>
async function start() {
if ('storage' in navigator && 'estimate' in navigator.storage) {
const {usage, quota} = await navigator.storage.estimate();
console.log(`Using ${usage} out of ${quota} bytes.`);
if(quota < 120000000){
alert('We see you! You are incognito!')
console.log('Incognito')
} else {
alert('Not incognito!')
console.log('Not Incognito')
}
} else {
console.log('Can not detect')
}
}
start();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment