is-private-navigation
Version:
detect Incognito Mode navigation
48 lines (37 loc) • 1.63 kB
Markdown
# is-private-navigation
<div style="display:inline">
[](https://travis-ci.org/Sylvain59650/is-private-navigation)





[](http://hits.dwyl.com/Sylvain59650/is-private-navigation)
</div>
# Detects Incognito Mode Navigation in browsers
### Works for IE11, Edge 17, FireFox 68, Chrome 76-83, Safari, Brave 1.10
### Reference the script
```html
<script src="node_modules/is-private-navigation/distrib/is-private-navigation.min.js"></script>
```
### Example
```html
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
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.5.0/bluebird.min.js"></script>
```
### Test Online
[click here](https://sylvain59650.github.io/is-private-navigation/)
### License
The license is MIT
Author: [Sylvain Longepée](https://github.com/Sylvain59650)