code to easily disable botguard, if desired
not recommended for general use, but can be good for occasional troubleshooting
This commit is contained in:
parent
cabe7692fe
commit
54a6861aef
@ -3,7 +3,11 @@
|
||||
|
||||
iitc_bg = Object();
|
||||
|
||||
iitc_bg.DISABLED = false; //if set, botguard is disabld. no b/c params sent in requests, no processing of responses
|
||||
|
||||
iitc_bg.init = function() {
|
||||
if (iitc_bg.DISABLED) return;
|
||||
|
||||
// stock site - 'ad.e()' constructor
|
||||
//function Ad() {
|
||||
// this.Eb = {}; // a map, indexed by 'group-[ab]-actions', each entry containing an array of 'yd' objects (simple object, with 'gf' and 'cb' members). a queue of data to process?
|
||||
@ -89,6 +93,8 @@ iitc_bg.push_queue = function(group, data, key) {
|
||||
// called both on initialisation and on processing responses from the server
|
||||
//
|
||||
iitc_bg.process_key = function(key,serverEval) {
|
||||
if (iitc_bg.DISABLED) return;
|
||||
|
||||
|
||||
// stock site code
|
||||
//function Bd(a, b, c) {
|
||||
@ -157,6 +163,8 @@ iitc_bg.get_method_group = function(method) {
|
||||
|
||||
// returns the extra parameters to add to any JSON request
|
||||
iitc_bg.extra_request_params = function(method) {
|
||||
if (iitc_bg.DISABLED) return {};
|
||||
|
||||
|
||||
var extra = {};
|
||||
extra.b = iitc_bg.key;
|
||||
@ -255,6 +263,15 @@ iitc_bg.process_queue = function(group) {
|
||||
|
||||
|
||||
iitc_bg.process_response_params = function(method,data) {
|
||||
if (iitc_bg.DISABLED) {
|
||||
// the rest of IITC won't expect these strange a/b/c params in the response data
|
||||
// (e.g. it's pointless to keep in the cache, etc), so clear them
|
||||
delete data.a;
|
||||
delete data.b;
|
||||
delete data.c;
|
||||
return;
|
||||
}
|
||||
|
||||
// stock site: response processing
|
||||
//yd.prototype.vi = function(a, b) {
|
||||
// var c = b.target;
|
||||
|
Loading…
x
Reference in New Issue
Block a user