Skip to content

Instantly share code, notes, and snippets.

View Choy-lingling's full-sized avatar

Choy-lingling

View GitHub Profile
@Choy-lingling
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 http://live.datatables.net/piduzelo/1
*
* This snippet uses ES2015 syntax. If you want to run it in old browsers, transpile it with Babel: