# detectincognitojs

> detectIncognito.js can be used to detect incognito mode & other private browsing modes on most modern browsers.

Latest version **1.9.0** (published 2026-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install detectincognitojs
pnpm add detectincognitojs
yarn add detectincognitojs
bun add detectincognitojs
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.9.0 |
| Published | 2026-08-09 |
| First published | 2022-09-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 59.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 552 |
| Author | Joe Rutkowski / Joe12387 |
| Maintainers | joe12387 |
| Keywords | incognito |

## Links

- npm: https://www.npmjs.com/package/detectincognitojs
- Repository: https://github.com/Joe12387/detectIncognito
- Homepage: https://github.com/Joe12387/detectIncognito#readme
- Issues: https://github.com/Joe12387/detectIncognito/issues
- npm.io page: https://npm.io/package/detectincognitojs

## Recent versions

- 1.9.0 (latest) — 2026-08-09
- 1.8.1 — 2026-08-09
- 1.8.0 — 2026-07-23
- 1.7.0 — 2026-05-31
- 1.6.2 — 2025-09-20
- 1.6.1 — 2025-08-06
- 1.6.0 — 2025-07-03
- 1.5.0 — 2025-05-11
- 1.4.1 — 2025-04-04
- 1.4.0 — 2025-04-04
- 1.3.7 — 2024-11-22
- 1.3.6 — 2024-11-12
- 1.3.5 — 2024-03-13
- 1.3.4 — 2024-03-13
- 1.3.3 — 2024-03-12
- … 8 more at https://npm.io/package/detectincognitojs/versions

## README

# detectIncognito.js

[![npm version](https://img.shields.io/npm/v/detectincognitojs)](https://www.npmjs.com/package/detectincognitojs)
[![Downloads](https://img.shields.io/npm/dm/detectincognitojs)](https://npmcharts.com/compare/detectincognitojs)
[![License](https://img.shields.io/npm/l/detectincognitojs)](https://opensource.org/licenses/MIT)

**Efficiently detect Incognito mode & other private browsing modes across most modern browsers.**

<img src="./detectIncognito.svg" width="150" />

---

## Features

- ✅ Incognito detection on Google Chrome
- ✅ Private Window detection on Safari (macOS)
- ✅ Private Tab detection on Safari (iOS)
- ✅ Private Window detection in Firefox
- ✅ InPrivate Window detection on Microsoft Edge
- ✅ InPrivate Window detection on Microsoft Internet Explorer
- ✅ Private Window detection in Brave (see notes)
- ✅ Private Window detection in Opera

## Demo

Check out the [live demo](https://detectincognito.com/).

## Usage

Get the script from CDN (may be blocked by adblockers—see notes):

```html
<script src="https://cdn.jsdelivr.net/gh/Joe12387/detectIncognito@main/dist/es5/detectIncognito.min.js"></script>
```

Or install via NPM:

```bash
npm i detectincognitojs
```

```javascript
import { detectIncognito } from "detectincognitojs";

detectIncognito().then((result) => {
  console.log(result.browserName, result.isPrivate);
});
```

## Supported Browsers

| Browser         | Platform(s) | Versions            | Notes                                                                                         |
|-----------------|-------------|---------------------|-----------------------------------------------------------------------------------------------|
| Safari          | All         | ≤ 26.5              |                                                                                               |
| Chromium        | All         | 83 to 150           |                                                                                               |
| Firefox         | All         | 44 to 153           |                                                                                               |
| MSIE            | Windows     | 11                  | Requires Promise polyfill                                                                     |

## Notes

- False positives can occur in certain browser setups or Chrome Guest mode ([Issue #21](https://github.com/Joe12387/detectIncognito/issues/21)).
- Firefox Container Tabs aren't detected by this.
- The script must run over HTTPS—running locally or via HTTP might fail.
- Brave and uBlock Origin block the CDN; hosting the script yourself avoids this issue.
- An error is thrown if the browser can't be identified.

## Similar Projects

- [OverpoweredJS](https://overpoweredjs.com/) – An advanced browser fingerprinting & bot detection solution.
- [Established Emails](https://establishedemails.com/) - Positive email reputation API for fraud teams, able to determine the minimum age of billions of emails.

## License

Copyright © 2026 Joe Rutkowski  
Distributed under the [MIT License](https://opensource.org/license/mit-0/).

---
_Source: https://npm.io/package/detectincognitojs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
