Skip to content

Instantly share code, notes, and snippets.

Avatar

Choy-lingling

View GitHub Profile
@Choy-lingling
Choy-lingling / is-private-mode.js
Last active Nov 19, 2021 — forked from jherax/is-private-mode.js
Detect if the browser is running in Private mode (Promise based)
View is-private-mode.js
// 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 http://live.datatables.net/piduzelo/1
*
* This snippet uses ES2015 syntax. If you want to run it in old browsers, transpile it with Babel: