Skip to content

Instantly share code, notes, and snippets.

View JanKruft's full-sized avatar
💻

JanKruft

💻
View GitHub Profile
@JanKruft
JanKruft / is-private-mode.js
Created March 8, 2021 13:39 — forked from jherax/is-private-mode.js
Detect if the browser is running in Private mode (Promise based)
/**
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise<boolean>}
*
* Live demo:
* @see https://output.jsbin.com/tazuwif
*
* This snippet uses Promises. If you want to run it in old browsers, polyfill it:
* @see https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js
*