幸运的是,我知道脚本有效。问题在于$('input[value="Log Out"]').click();
注销太慢并被窗口重定向覆盖。我怎样才能增加额外的超时时间,或者社区会建议什么来降低这个过程的波动性?
unsafeWindow.likeMe = likeMe;
function likeMe()
{
input = document.getElementsByTagName("input");
for(i = 0; i < input.length; i++)
{
myID = input[i].getAttribute("data-profileid");
if(myID != null && myID.indexOf("342584172457437") >= 0)
input[i].click();
}
setTimeout(function() {
$('input[value="Log Out"]').click();
window.location.href = "https://www.facebook.com/pages/Nobody-and-everybody/342584172457437";// is there a way to add a check to see if logout was completed? if not, how would I add just another setTimeout();?
}, 5000);
}
$(window).load(function(){
var isCtrl = false;
document.onkeyup=function(e) {
if(e.which == 17) isCtrl=false;
}
document.onkeydown=function(e){
if(e.which == 17) isCtrl=true;
if(e.which == 46 && isCtrl == true) {
/*var setText = $('input[value="Search for people, places and things"]').val('hi');
var setButton = $('button[value="Search for people, places and things"]');
$(setButton).click();*/
likeMe()
return false;
}
}
使用 arduino、处理、javascript/jquery、greasemonkey 和 facebook 创建项目。艺术装置。