这段代码有什么作用?

JPv*_*rwe 2 javascript facebook

对于缺乏不喜欢按钮的呻吟现在在Facebook上风靡一时,各种团体如雨后春笋般涌现出来提供了一个不喜欢的按钮,但只有在你邀请了x你的朋友之后.

其中一个(可能是狡猾的?)组要求您在加入过程中运行Javascript.我还没有做过网页编码所以我想知道是否有人可以告诉我下面的代码是做什么的?

javascript:elms=document.getElementById('friends').getElementsByTagName('li');
for(var fid in elms){
     if(typeof elms[fid] === 'object'){
          fs.click(elms[fid]);
     }
}
Run Code Online (Sandbox Code Playgroud)

该组的链接在这里:|►OFFICIALDislikeButton™终于在这里◄| 现在添加它,它实际上工作!.该代码列在最近新闻部分的3个步骤中.

Leo*_*Leo 8

// Find the Element in the webpage that has the ID "friends", which is the list of your friends ;-)
javascript:elms=document.getElementById('friends').getElementsByTagName('li'); 
// Iterate over every friend in the list
for(var fid in elms){ 
     // just a validation
     if(typeof elms[fid] === 'object'){ 
          // Click on the invite to Group button
          fs.click(elms[fid]); 
     } 
} 
Run Code Online (Sandbox Code Playgroud)

基本上,此代码会为您的所有朋友提供群组邀请 ;-)