-
-
Save ehershey/851e9d6f27bdc6a91d80d6b121b8238e to your computer and use it in GitHub Desktop.
Tampermonkey script to fake incognito check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 http://www.cnbc.com/* | |
// @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); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment