javascript - What is CavalryLogger and do I need it? -


i'm doing optimisation on site ive taken over. i've found script don't recognise: http://static.ak.fbcdn.net/rsrc.php/zo/r/v95lkt_ulnb.js

it facebook thing, , there's key logging going on (that im not keen on)

it without doubt largest file being requested on page load (87kb) if can without it, it'll speed page load.

does know:
a) is
b) it's for
c) does
d) can without

okay had on beautified version of minified code , have noted following:

by these bunch of utility functions.

cavalrylogger doesn't file because doesn't exist, nor defined.

the code in question regarding key binding:

function keyeventcontroller() {   copy_properties(this, {     handlers: {}   });   document.onkeyup = this.onkeyevent.bind(this, 'onkeyup');   document.onkeydown = this.onkeyevent.bind(this, 'onkeydown');   document.onkeypress = this.onkeyevent.bind(this, 'onkeypress'); } copy_properties(keyeventcontroller, {   instance: null,   getinstance: function () {     return keyeventcontroller.instance || (keyeventcontroller.instance = new keyeventcontroller());   },   defaultfilter: function (event, a) {     event = $e(event);     return keyeventcontroller.filtereventtypes(event, a) && keyeventcontroller.filtereventtargets(event, a) && keyeventcontroller.filtereventmodifiers(event, a);   },   filtereventtypes: function (event, a) {     if (a === 'onkeydown') return true;     return false;   },   filtereventtargets: function (event, b) {     var = $e(event).gettarget();     if (dom.isnode(a, ['input', 'select', 'textarea', 'object', 'embed'])) if (a.type != 'checkbox' && a.type != 'radio' && a.type != 'submit') return false;     return a.getattribute('contenteditable') != 'true';   },   filtereventmodifiers: function (event, a) {     if (event.ctrlkey || event.altkey || event.metakey || event.repeat) return false;     return true;   },   registerkey: function (f, a, d, g) {     if (d === undefined) d = keyeventcontroller.defaultfilter;     var b = keyeventcontroller.getinstance();     var c = b.mapkey(f);     if (is_empty(b.handlers)) onleaveregister(b.resethandlers.bind(b));     (var e = 0; e < c.length; e++) {       f = c[e];       if (!b.handlers[f] || g) b.handlers[f] = [];       b.handlers[f].push({         callback: a,         filter: d       });     }   },   keycodemap: {     '[': [219],     ']': [221],     '`': [192],     left: [keys.left, 63234],     right: [keys.right, 63235],     return: [keys.return],     tab: [keys.tab],     down: [keys.down, 63233],     up: [keys.up, 63232],     escape: [keys.esc],     backspace: [keys.backspace],     delete: [keys.delete]   } }); copy_properties(keyeventcontroller.prototype, {   mapkey: function (a) {     if (typeof (a) == 'number') return [48 + a, 96 + a];     if (keyeventcontroller.keycodemap[a.touppercase()]) return keyeventcontroller.keycodemap[a.touppercase()];     var b = a.touppercase().charcodeat(0);     return [b];   },   onkeyevent: function (i, c) {     c = $e(c);     var d = null;     var g = this.handlers[c.keycode];     var b, f, a;     if (g) (var h = 0; h < g.length; h++) {       b = g[h].callback;       f = g[h].filter;       try {         if (!f || f(c, i)) {           var node = null;           if (window.parent && parent.bytag && c.gettarget) node = parent.bytag(c.gettarget(), 'a');           user_action(node, 'key', c);           = b(c, i);           if (a === false) return event.kill(c);         }       } catch (e) {}     }     return true;   },   resethandlers: function () {     this.handlers = {};   } }); 

this code lets bind keys callbacks, , includes more human readable names common keys. take example usage here:

keyeventcontroller.registerkey('escape', dialog._handleescapekey, a); 

the escape key registered make dialogs go away. handlers empty default, nothing going happen until use registerkey or append manually. note instance of registerkey being called.

it has lot of ajax utility functions. can't send facebook domain anyways because of same origin policy (unless modified security permissions, that's fault). same thing cookies set.

there's history manger, uses iframe won't able read domain anyways.

finally button code found iframe, wouldn't need js includes unless using javascript create iframe or something.

with in mind don't see need include this.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -