Skip to content

Instantly share code, notes, and snippets.

@matyasfodor
Created December 27, 2017 04:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save matyasfodor/857119359db3f4820f85d42c0531a08c to your computer and use it in GitHub Desktop.
Save matyasfodor/857119359db3f4820f85d42c0531a08c to your computer and use it in GitHub Desktop.
Tampermonkey script to fake incognito check
// ==UserScript==
// @name Incognito trick
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Prevent sites detecting if you're in incognito by calling the success callback of webkitRequestFileSystem even if it's failing.
// @author You
// @run-at document-start
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function injectScript(script, node) {
var element = document.createElement('script');
element.setAttribute('type', 'text/javascript');
element.setAttribute('async', false);
element.text = script;
node.appendChild(element);
}
var node = document.documentElement;
var script = `(function(webkitRequestFileSystem) {
window.webkitRequestFileSystem = function(type, size, successCallback, errorCallback) {
webkitRequestFileSystem(type, size, successCallback, successCallback);
}
})(window.webkitRequestFileSystem);`;
injectScript(script, node);
})();
@buhtig1234
Copy link

I was wondering if you have a similar way to do this for Firefox? Thanks in advance.

@muckjail
Copy link

Sweet worked as advertised! To the last commenter I use greasemenkey on firefox. Just make a new script copy this code into a new script and off you go.
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment