Skip to content

Instantly share code, notes, and snippets.

View Choy-lingling's full-sized avatar


View GitHub Profile
Choy-lingling / is-private-mode.js
Last active November 19, 2021 17:12 — forked from jherax/is-private-mode.js
Detect if the browser is running in Private mode (Promise based)
// uncomment if you are transpiling with Babel + Webpack
// const { window, document } = global;
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise}
* Live demo:
* @see
* This snippet uses ES2015 syntax. If you want to run it in old browsers, transpile it with Babel: