什么是Facebook的功能__d [英] What is Facebook's function __d
问题描述
我正在开发一个项目(希望)涉及利用已经内置到Facebook中的一些javascript。但是我马上遇到了障碍,我无法弄清楚 __ d
是什么。
I'm working on a project that (hopefully) involves taking advantage of some of the javascript that's already built into Facebook. But right away I've got a roadblock in that I can't figure out what __d
is.
如果你看一下源javascript文件,几乎每个命令都以 __ d
If you look at the source javascript files, pretty much every command begins with __d
开头例如:
__d("legacy:live-timer",["LiveTimer"],function(a,b,c,d){a.LiveTimer=b('LiveTimer');},3);
但我找不到任何javascript文件中的任何内容 __ d
确实如此。是不是必须在某处定义所有这些其他功能才能利用它?
But I can't find anywhere in any of the javascript files what __d
actually does. Shouldn't it have to be defined somewhere for all these other functions to take advantage of it?
更新:
所以,假设有一个网站上有这样的javascript ...
So let's say there's a site with some javascript like this...
function alertSomething(var) {
if (var) alert("Here it is: "+var);
}
if (some condition) alertSomething("something");
现在假设我有一个Chrome扩展程序,我可以将自己的Javascript注入页面。不能\我的Chrome扩展Javascript有这样的东西......
Now let's say I had a Chrome Extension and I was able to inject my own Javascript into the page. Couldn't \my Chrome Extension Javascript have something like this...
if (some other condition) alertSomething("something else");
因此,我会利用页面上已存在的javascript中的一些代码?
Thus I would be taking advantage of some code that exists in the javascript already on the page?
推荐答案
我在<$ c $的第20行找到 __ d
的定义C> 1LWPxIBQ4v0.js 。不知道文件是否为每个人命名相同。搜索 a .__ d = function(s,t,u,v)
( a
是全局对象,即窗口
,有效地使 __ d
全局函数)。尽管如此,祝你好运......
I found the definition of __d
on line 20 of 1LWPxIBQ4v0.js
. No idea if the file is named the same for everyone. Search for "a.__d=function(s,t,u,v)
" (a
is the global object, i.e. window
, effectively making __d
a global function). Good luck with that de-minification though...
这篇关于什么是Facebook的功能__d的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!