var code = function(){
var org = document.cookie.__lookupSetter__('cookie');
document.__defineSetter__("cookie",function(cookie){
if(cookie.indexOf('v=')>-1){
debugger;
}
org = cookie;
});
document.__defineGetter__("cookie",function(){return org;});
}
var script = document.createElement('script');
script.textContent = '(' + code + ')()';
(document.head||document.documentElement).appendChild(script);
script.parentNode.removeChild(script);
(function() {
"use strict";
var cookieTemp = "";
Object.defineProperty(document, "cookie", {
writable: false,
configurable: false,
set: function(val) {
if (val.indexOf("v=") != -1) {
debugger ;
}
console.log("Hook捕获Cookie设置->", val);
cookieTemp = val;
return val;
},
get: function() {
return cookieTemp;
}
})
}
)();