Created
July 9, 2012 10:15
-
-
Save kageroh/3075612 to your computer and use it in GitHub Desktop.
JavaScript からは Cookie が無効に見えたり、DNT が yes に見えるやつ。
This file contains 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 secure.js | |
// @namespace http://twitter.com/amasawa | |
// @include * | |
// ==/UserScript== | |
(function () { | |
try { | |
var e = function () { return ''; }; | |
var f = function () { return false; }; | |
var y = function () { return 'yes'; }; | |
Object.defineProperty(document, 'cookie', { | |
get: e, | |
set: e, | |
configurable: false | |
}); | |
Object.defineProperty(navigator, 'cookieEnabled', { | |
get: f, | |
set: f, | |
configurable: false | |
}); | |
Object.defineProperty(navigator, 'doNotTrack', { | |
get: y, | |
set: y, | |
configurable: false | |
}); | |
} catch (e) { | |
alert(e); | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment