-
Notifications
You must be signed in to change notification settings - Fork 0
/
Incodnito.user.js
28 lines (27 loc) · 1.02 KB
/
Incodnito.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// ==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);
})();