什么是CavalryLogger,我需要它吗?

时间:2023-01-24 13:14:51

I'm doing some optimisation on a site Ive recently taken over. I've found a script I don't recognise: http://static.ak.fbcdn.net/rsrc.php/zo/r/V95Lkt_uLNB.js

我正在对最近接手的网站进行一些优化。我发现了一个我不认识的脚本:http://static.ak.fbcdn.net/rsrc.php/zo/r/V95Lkt_uLNB.js

It could be a facebook thing, and there's some key logging going on (that Im not too keen on)

它可能是一个facebook的东西,并且有一些关键日志记录正在进行(我不太热衷)

It is without a doubt the largest file being requested on a page load (87kb) so if I can do without it, it'll really speed up the page load.

毫无疑问,在页面加载(87kb)上请求的最大文件是如此,如果我没有它,它将真正加快页面加载。

Does anyone know:
A) What it is
B) What it's for
C) What it does
D) Can I do without it

有谁知道:A)它是什么B)它是什么C)它做什么D)没有它可以做到

7 个解决方案

#1


30  

Okay so I had a look over the beautified version of this minified code and have noted the following:

好的,所以我查看了这个缩小代码的美化版本,并注意到以下内容:

By itself these are a bunch of utility functions.

这些本身就是一堆实用功能。

CavalryLogger doesn't do anything with this file by itself because it doesn't exist, nor is it defined.

CavalryLogger本身不对此文件执行任何操作,因为它不存在,也不定义。

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 a = $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));
    for (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) for (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);
          a = b(c, i);
          if (a === false) return Event.kill(c);
        }
      } catch (e) {}
    }
    return true;
  },
  resetHandlers: function () {
    this.handlers = {};
  }
});

This code lets you bind keys to callbacks, and includes more human readable names for common keys. Take for example the usage here:

此代码允许您将键绑定到回调,并包含更多人类可读的公用键名称。以这里的用法为例:

KeyEventController.registerKey('ESCAPE', Dialog._handleEscapeKey, a);

The ESCAPE key is registered to make Dialogs go away. handlers is also empty by default, so nothing is going to happen until you use registerKey or append to it manually. Note that this is the only instance of registerKey being called.

注册ESCAPE密钥以使对话框消失。默认情况下,处理程序也是空的,因此在您使用registerKey或手动追加之前不会发生任何事情。请注意,这是调用registerKey的唯一实例。

It also has a lot of AJAX utility functions. Can't really send anything to Facebook from your domain anyways because of same origin policy (unless you modified security permissions, but then that's your fault). Same thing with the cookies set.

它还有很多AJAX实用程序功能。无论如何都无法从你的域发送任何东西到Facebook,因为相同的原始政策(除非你修改了安全权限,但那是你的错)。与Cookie设置相同。

There's also a history manger, but it uses an iFrame so it won't be able to read it from your domain anyways.

还有一个历史管理器,但它使用iFrame,因此无论如何它都无法从您的域中读取它。

Finally the like button code I found is an iFrame, so it wouldn't need JS includes unless you were using javascript to create the iFrame or something.

最后,我找到的类似按钮代码是一个iFrame,因此它不需要JS包含,除非你使用javascript创建iFrame或其他东西。

With that in mind I don't see the need for you to include all this.

考虑到这一点,我认为你不需要包括所有这些。

#2


11  

It looks like this is directly connected to having the "Like this" functionality on a page. The iframe you use to include the 'Like' button seems to come with a couple of 'bonus' scripts.

看起来这与页面上的“喜欢这个”功能直接相关。您用来包含“赞”按钮的iframe似乎附带了几个“奖励”脚本。

If you ask me, this is another good reason to NOT have Facebook integrated, it appears to be logging keypresses, and that is not cool.

如果你问我,这是没有Facebook集成的另一个好理由,它似乎是记录按键,这并不酷。

#3


1  

A quick google search doesn't provide alot of answers - it's some sort of event tracking script for Facebook, and I saw a tweet and a couple of forum posts where people mentioned disabling it and gaining a speed boost - I think you can safely get rid of it, atleast it's worth giving it a try.

一个快速谷歌搜索没有提供很多答案 - 这是Facebook的某种事件跟踪脚本,我看到一条推文和几个论坛帖子,人们提到禁用它并获得速度提升 - 我认为你可以安全地获得摆脱它,至少值得尝试一下。

#4


0  

This is definitely from Facebook - one of many supporting files for FBML / API / etc.

这绝对是来自Facebook-- FBML / API /等许多支持文件之一。

If you are not using any FB features in your project, simply remove this file.

如果您未在项目中使用任何FB功能,只需删除此文件即可。

If you are using any FB features (like 'Like' button), you shouldn't use this file (or any other files with cryptic names) directly either. You should instead

如果您使用任何FB功能(如“喜欢”按钮),则不应直接使用此文件(或任何其他具有神秘名称的文件)。你应该改为

1) create empty <div id="fb-root"></div> somewhere at the end f your page

1)在页面末尾的某处创建空

2) include http://connect.facebook.net/en_US/all.js script in your page

2)在您的页面中包含http://connect.facebook.net/en_US/all.js脚本

3) follow further instructions from http://developers.facebook.com/

3)按照http://developers.facebook.com/的进一步说明进行操作

#5


0  

When the IFRAME is loaded it calls the following URI:

加载IFRAME时,它会调用以下URI:

https://www.facebook.com/plugins/like.php?api_key=[your_api_key]&channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D27%23cb%3Df39f390d40f7332%26domain%3D[your_TLD]%26origin%3Dhttp%253A%252F%252F[your_TLD]%252Ff72f1f9bea899e%26relation%3Dparent.parent&colorscheme=light&extended_social_context=false&href=[your_share_URI]&layout=button_count&locale=en_US&node_type=link&sdk=joey&send=false&show_faces=false&width=100

Within the script tags of this page are the following calls.

在此页面的脚本标记内是以下调用。

PluginAsyncLoader.load("**https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yq\/r\/CNRdIwfy3yI.js**");
PluginAsyncLoader.ondemandjs = "**https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yH\/r\/muz85bheueJ.js**";

#6


0  

I found "calverly logger" in a file that I did not download but I saw it download right in front of me when I closed Thunderbird (was running Firefox behind it and it showed up there as a file downloading) so went to check what it was.

我在一个我没有下载的文件中找到了“calverly logger”,但是当我关闭Thunderbird(在它后面运行Firefox并且它显示在那里作为文件下载)时,我看到它正在我面前下载所以去检查它是什么是。

The file was called: "See All.html" which I found odd and worrying.

该文件被称为:“请参阅All.html”,我觉得奇怪和令人担忧。

the head of the file contains the following code indicating it is a Facebook function... The Calvery Logger is mentioned near the bottom of the file (not shown here). I have stripped out the html < near the head of the file so that you can see the code... Not sure it will help but look forward to any insights...

该文件的头部包含以下代码,表明它是一个Facebook功能...在文件底部附近提到了Calvery Logger(此处未显示)。我已经删除了文件头部附近的html <以便您可以看到代码...不确定它会有所帮助但是期待任何见解......< p>

// !DOCTYPE html 
html lang="en" id="facebook" class="no_js"

head
meta charset="utf-8" />

meta name="referrer" content="origin-when-crossorigin" id="meta_referrer" />

script> window._cstart=+new Date();</script><script>function envFlush(a)    {function b(c){for(var d in a)c[d]=a[d];}if(window.requireLazy){window.requireLazy(['Env'],b);}else{window.Env=window.Env||{};b(window.Env);}}envFlush({"ajaxpipe_token":"AXiYOZarFarwOff3","lhsh":"AAQFK_mp-","khsh":"0`sj`e`rm`s-0fdu^gshdoer-0gc^eurf-3gc^eurf;1;enbtldou;fduDmdldourCxO`ld-2YLMIuuqSdptdru;qsnunuxqd;rdoe-0unjdojnx-0unjdojnx0-0gdubi^rdbsduOdv-0`sj`e`r-0q`xm`r-0StoRbs`qhof-0mhoj^q`xm`r","timeslice_heartbeat_config":{"pollIntervalMs":33,"idleGapThresholdMs":60,"ignoredTimesliceNames":{"requestAnimationFrame":true,"Event listenHandler mousemove":true,"Event listenHandler mouseover":true,"Event listenHandler mouseout":true,"Event listenHandler scroll":true},"enableOnRequire":true},"shouldLogCounters":false,"timeslice_categories":{"react_render":true,"reflow":true}}); script> style> style>

#7


0  

It's linked to a virus hacker on Facebook, sending videos to all the friends of the person who's been hacked. If you open such a video, you too become hacked and all your friends get the video too. Do not open any suspect videos or messages, particularly in Messenger.

它与Facebook上的病毒黑客相关联,将视频发送给被黑客入侵的所有朋友。如果您打开这样的视频,您也会被黑客攻击,所有朋友也会收到视频。不要打开任何可疑的视频或消息,尤其是在Messenger中。

#1


30  

Okay so I had a look over the beautified version of this minified code and have noted the following:

好的,所以我查看了这个缩小代码的美化版本,并注意到以下内容:

By itself these are a bunch of utility functions.

这些本身就是一堆实用功能。

CavalryLogger doesn't do anything with this file by itself because it doesn't exist, nor is it defined.

CavalryLogger本身不对此文件执行任何操作,因为它不存在,也不定义。

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 a = $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));
    for (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) for (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);
          a = b(c, i);
          if (a === false) return Event.kill(c);
        }
      } catch (e) {}
    }
    return true;
  },
  resetHandlers: function () {
    this.handlers = {};
  }
});

This code lets you bind keys to callbacks, and includes more human readable names for common keys. Take for example the usage here:

此代码允许您将键绑定到回调,并包含更多人类可读的公用键名称。以这里的用法为例:

KeyEventController.registerKey('ESCAPE', Dialog._handleEscapeKey, a);

The ESCAPE key is registered to make Dialogs go away. handlers is also empty by default, so nothing is going to happen until you use registerKey or append to it manually. Note that this is the only instance of registerKey being called.

注册ESCAPE密钥以使对话框消失。默认情况下,处理程序也是空的,因此在您使用registerKey或手动追加之前不会发生任何事情。请注意,这是调用registerKey的唯一实例。

It also has a lot of AJAX utility functions. Can't really send anything to Facebook from your domain anyways because of same origin policy (unless you modified security permissions, but then that's your fault). Same thing with the cookies set.

它还有很多AJAX实用程序功能。无论如何都无法从你的域发送任何东西到Facebook,因为相同的原始政策(除非你修改了安全权限,但那是你的错)。与Cookie设置相同。

There's also a history manger, but it uses an iFrame so it won't be able to read it from your domain anyways.

还有一个历史管理器,但它使用iFrame,因此无论如何它都无法从您的域中读取它。

Finally the like button code I found is an iFrame, so it wouldn't need JS includes unless you were using javascript to create the iFrame or something.

最后,我找到的类似按钮代码是一个iFrame,因此它不需要JS包含,除非你使用javascript创建iFrame或其他东西。

With that in mind I don't see the need for you to include all this.

考虑到这一点,我认为你不需要包括所有这些。

#2


11  

It looks like this is directly connected to having the "Like this" functionality on a page. The iframe you use to include the 'Like' button seems to come with a couple of 'bonus' scripts.

看起来这与页面上的“喜欢这个”功能直接相关。您用来包含“赞”按钮的iframe似乎附带了几个“奖励”脚本。

If you ask me, this is another good reason to NOT have Facebook integrated, it appears to be logging keypresses, and that is not cool.

如果你问我,这是没有Facebook集成的另一个好理由,它似乎是记录按键,这并不酷。

#3


1  

A quick google search doesn't provide alot of answers - it's some sort of event tracking script for Facebook, and I saw a tweet and a couple of forum posts where people mentioned disabling it and gaining a speed boost - I think you can safely get rid of it, atleast it's worth giving it a try.

一个快速谷歌搜索没有提供很多答案 - 这是Facebook的某种事件跟踪脚本,我看到一条推文和几个论坛帖子,人们提到禁用它并获得速度提升 - 我认为你可以安全地获得摆脱它,至少值得尝试一下。

#4


0  

This is definitely from Facebook - one of many supporting files for FBML / API / etc.

这绝对是来自Facebook-- FBML / API /等许多支持文件之一。

If you are not using any FB features in your project, simply remove this file.

如果您未在项目中使用任何FB功能,只需删除此文件即可。

If you are using any FB features (like 'Like' button), you shouldn't use this file (or any other files with cryptic names) directly either. You should instead

如果您使用任何FB功能(如“喜欢”按钮),则不应直接使用此文件(或任何其他具有神秘名称的文件)。你应该改为

1) create empty <div id="fb-root"></div> somewhere at the end f your page

1)在页面末尾的某处创建空

2) include http://connect.facebook.net/en_US/all.js script in your page

2)在您的页面中包含http://connect.facebook.net/en_US/all.js脚本

3) follow further instructions from http://developers.facebook.com/

3)按照http://developers.facebook.com/的进一步说明进行操作

#5


0  

When the IFRAME is loaded it calls the following URI:

加载IFRAME时,它会调用以下URI:

https://www.facebook.com/plugins/like.php?api_key=[your_api_key]&channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D27%23cb%3Df39f390d40f7332%26domain%3D[your_TLD]%26origin%3Dhttp%253A%252F%252F[your_TLD]%252Ff72f1f9bea899e%26relation%3Dparent.parent&colorscheme=light&extended_social_context=false&href=[your_share_URI]&layout=button_count&locale=en_US&node_type=link&sdk=joey&send=false&show_faces=false&width=100

Within the script tags of this page are the following calls.

在此页面的脚本标记内是以下调用。

PluginAsyncLoader.load("**https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yq\/r\/CNRdIwfy3yI.js**");
PluginAsyncLoader.ondemandjs = "**https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/v2\/yH\/r\/muz85bheueJ.js**";

#6


0  

I found "calverly logger" in a file that I did not download but I saw it download right in front of me when I closed Thunderbird (was running Firefox behind it and it showed up there as a file downloading) so went to check what it was.

我在一个我没有下载的文件中找到了“calverly logger”,但是当我关闭Thunderbird(在它后面运行Firefox并且它显示在那里作为文件下载)时,我看到它正在我面前下载所以去检查它是什么是。

The file was called: "See All.html" which I found odd and worrying.

该文件被称为:“请参阅All.html”,我觉得奇怪和令人担忧。

the head of the file contains the following code indicating it is a Facebook function... The Calvery Logger is mentioned near the bottom of the file (not shown here). I have stripped out the html < near the head of the file so that you can see the code... Not sure it will help but look forward to any insights...

该文件的头部包含以下代码,表明它是一个Facebook功能...在文件底部附近提到了Calvery Logger(此处未显示)。我已经删除了文件头部附近的html <以便您可以看到代码...不确定它会有所帮助但是期待任何见解......< p>

// !DOCTYPE html 
html lang="en" id="facebook" class="no_js"

head
meta charset="utf-8" />

meta name="referrer" content="origin-when-crossorigin" id="meta_referrer" />

script> window._cstart=+new Date();</script><script>function envFlush(a)    {function b(c){for(var d in a)c[d]=a[d];}if(window.requireLazy){window.requireLazy(['Env'],b);}else{window.Env=window.Env||{};b(window.Env);}}envFlush({"ajaxpipe_token":"AXiYOZarFarwOff3","lhsh":"AAQFK_mp-","khsh":"0`sj`e`rm`s-0fdu^gshdoer-0gc^eurf-3gc^eurf;1;enbtldou;fduDmdldourCxO`ld-2YLMIuuqSdptdru;qsnunuxqd;rdoe-0unjdojnx-0unjdojnx0-0gdubi^rdbsduOdv-0`sj`e`r-0q`xm`r-0StoRbs`qhof-0mhoj^q`xm`r","timeslice_heartbeat_config":{"pollIntervalMs":33,"idleGapThresholdMs":60,"ignoredTimesliceNames":{"requestAnimationFrame":true,"Event listenHandler mousemove":true,"Event listenHandler mouseover":true,"Event listenHandler mouseout":true,"Event listenHandler scroll":true},"enableOnRequire":true},"shouldLogCounters":false,"timeslice_categories":{"react_render":true,"reflow":true}}); script> style> style>

#7


0  

It's linked to a virus hacker on Facebook, sending videos to all the friends of the person who's been hacked. If you open such a video, you too become hacked and all your friends get the video too. Do not open any suspect videos or messages, particularly in Messenger.

它与Facebook上的病毒黑客相关联,将视频发送给被黑客入侵的所有朋友。如果您打开这样的视频,您也会被黑客攻击,所有朋友也会收到视频。不要打开任何可疑的视频或消息,尤其是在Messenger中。