is-private-navigation
Detects Incognito Mode Navigation in browsers
Works for IE11, Edge 17, FireFox 68, Chrome 76-83, Safari, Brave 1.10
Reference the script
Example
isPrivateMode().then(function(isPrivate) { if (isPrivate) { console.log("You are using Private Navigation"); } else { console.log("You are using Normal Navigation Mode"); }});
For IE 11,
you need to load script to define Promise polyfill
Test Online
License
The license is MIT
Author: Sylvain Longepée