Creating an alternate version of a site when viewed in Incognito mode?

You can find two current methods here:

https://www.bleepingcomputer.com/news/google/google-chrome-incognito-mode-can-still-be-detected-by-these-methods/

Here's a script from the first method that detects Incognito with JS:

<script async>
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>`

/r/web_design Thread