Directory / plugin
Incognito Window Detect
v2.0.0 · by Samuel Silva
Show a customisable notice to visitors who are browsing your site in an incognito or private window.
About this plugin
Incognito mode (also called a private window) is a great privacy feature, but it also disables the cookies and storage that many sites rely on for a good experience: remembered preferences, personalised suggestions, saved carts, and so on.
Incognito Window Detect lets you tell those visitors what is going on. When a private window is detected, it shows a message you write, either as a discreet bar at the bottom of the page or as a full-screen overlay.
Features
- Bottom bar or full-screen overlay
- Your own message, with basic HTML (bold, links, line breaks)
- Custom background and text colours and font size
- Optional dismiss button, remembered for the browsing session
- Optional delay before the notice appears
- Show it on the whole site or only on the pages you pick
- Accessible markup (live region for the bar, dialog semantics for the overlay, keyboard dismiss)
- No jQuery on the front end, no external requests, nothing tracked
How detection works
Detection runs entirely in the visitor’s browser using the open-source detectIncognito.js library (MIT licence), which is bundled with the plugin. The bundled file is the ES5 build of release v1.9.0; the unminified source is available at dist/detectIncognito.js in that release. It uses storage-behaviour heuristics that differ between normal and private windows in Chrome, Edge, Brave, Opera, Firefox and Safari. Nothing is sent anywhere and no data is stored about the visitor.
Like every private-mode detector, it is a best-effort check. Browsers change how private windows behave, so an occasional false positive or miss is possible. When the browser cannot be identified, nothing is shown.
Browser support
Verified by the plugin author on 29 October 2026 with the bundled detection library (private window detected, regular window not flagged):
- Google Chrome 156 (macOS)
- Mozilla Firefox 152 (macOS)
- Safari 17.4 (macOS)
Supported by the detection library, not individually verified by the plugin author: Chromium-based browsers from version 83 (Chrome, Microsoft Edge, Brave, Opera, Chrome for Android), Firefox from version 44, Safari on macOS and iOS up to 26.5. Internet Explorer is not supported.
Known limitations:
- Detection only works on sites served over HTTPS (or localhost).
- Firefox container tabs are not detected.
- Chrome Guest mode and profiles stored on a RAM disk can be reported as private.
- Browser vendors actively close detection signals, so a new browser release can cause misses until the library is updated. The plugin fails safe: when in doubt, no notice is shown.
For developers
Filters:
incognito_window_detect_should_load– decide per request whether to load the notice.incognito_window_detect_settings– adjust the settings array.incognito_window_detect_message– change the message HTML.incognito_window_detect_allowed_html– change the HTML tags allowed in the message.incognito_window_detect_script_config– change the configuration passed to the front-end script.
DOM events dispatched on the notice element (they bubble to document):
incognito-window-detect:result– after detection, withdetail.isPrivateanddetail.browserName.incognito-window-detect:shownandincognito-window-detect:dismissed.
Privacy note for developers: out of the box the detection result never leaves the visitor’s browser. If you use the result event to send it to your server or to an analytics tool, you are collecting information from the visitor’s device, which may require consent under the ePrivacy rules that apply to your site.
The notice element keeps the 1.x class names (incognito_mode_isPrivateMode, incognito_mode_isPrivateMode__overlay) alongside the new ones, so existing custom CSS keeps working.