Skip to content

Instantly share code, notes, and snippets.

View lukasotocerny's full-sized avatar

Lukas Cerny lukasotocerny

  • University of Edinburgh; UCL
View GitHub Profile
@lukasotocerny
lukasotocerny / is-private-mode.js
Created December 28, 2017 07:17 — forked from jherax/is-private-mode.js
Detect if a browser is in Private Browsing mode
/**
* Detect if the browser is running in Private Browsing mode
*
* @export
* @returns {Promise}
*/
export default function isPrivateMode() {
return new Promise((resolve) => {
const on = () => resolve(true); // is in private mode
const off = () => resolve(false); // not private mode