Movatterモバイル変換


[0]ホーム

URL:


detectincognitojs
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

npm versionDownloadsLicense

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

Shameless plug:Looking for a powerful user tracking and bot detection solution?


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 thelive demo.

Usage

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

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

Or install via NPM:

npm i detectincognitojs
import{detectIncognito}from"detectincognitojs";detectIncognito().then((result)=>{console.log(result.browserName,result.isPrivate);});

Supported Browsers

BrowserPlatform(s)VersionsNotes
SafariAll≤ 18.4
ChromiumAll50 to 137 BetaDetection broken bypredictable-reported-quota flag (Issue #49)
FirefoxAll44 to 138
MSIEWindows11Requires Promise polyfill

Notes

  • False positives can occur in certain browser setups or Chrome Guest mode (Issue #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 – An advanced browser fingerprinting & bot detection solution.

License

Copyright © 2025 Joe Rutkowski
Distributed under theMIT License.

Readme

Keywords

Package Sidebar

Install

npm i detectincognitojs

Weekly Downloads

46,787

Version

1.6.0

License

MIT

Unpacked Size

47.1 kB

Total Files

9

Last publish

Collaborators

  • joe12387

[8]ページ先頭

©2009-2025 Movatter.jp