Last active
August 1, 2019 11:10
-
-
Save naveenyagati/d7f0f09c8ac10b56392f824f2190091b to your computer and use it in GitHub Desktop.
Chrome Incognito Detection
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
<script > | |
if ('storage' in navigator && 'estimate' in navigator.storage) { | |
navigator.storage.estimate() | |
.then(function(estimate){ | |
console.log(`Using ${estimate.usage/1e+6} out of ${estimate.quota/1e+6} bytes.`); | |
if(estimate.quota/1e+6 < 116.361073){ | |
alert("Why Incognito ?"); | |
}}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment