Skip to content

Instantly share code, notes, and snippets.

guy-a

Block or report user

Report or block guy-a

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@guy-a
guy-a / detect-private-browsing.js
Created Mar 22, 2016 — forked from cou929/detect-private-browsing.js
Detect private browsing mode (InPrivate Browsing or Incognito).
View detect-private-browsing.js
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
You can’t perform that action at this time.