diff --git a/code/botguard_interface.js b/code/botguard_interface.js index b20a1d3b..41083936 100644 --- a/code/botguard_interface.js +++ b/code/botguard_interface.js @@ -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;