I would like to ask if it is possible to create a Chrome or Greasemonkey script, a witch could open all the pop-ups in the queue. So far, I have 2 separate scenarios for this, but this does not work well, because the pop-ups have an anti-spam function that does not allow too many of them at the same time.
What I would like to do is to process an array of pop-up links in queue mode and only open after closing the previous one. I have no experience when it goes into queues and any event bindings.
So, the resources that I received:
1) An array of already prepared links
var URL_Array = [];
$('form[name="form_gallery"] .img img').each(function(i,e){
if($(this).closest('.object').children('.phs_voted_count').length == 0){
var string = e.src;
var nowBrake = string.substring(string.length-7,7);
var splited = nowBrake.split('/');
var urlStr = '/window/friend/gallery_view/'+splited[3]+'/'+splited[4]+'.html';
URL_Array[i] = urlStr;
}
});
2) the script that voted for the image in the popup
var voteBy = '#vte_mark_12';
var voteDefault = '#vte_mark_5';
var voteFormLoc = 'image_voting';
var buyExtraVote = 'image_voting_buy';
var captchaLoc = 'input[name="captcha"]';
var captchaTxt = 'Enter captcha text!';
var simpatyFormId = '#sym_send';
var startScript = true;
var formProcessedAlready = false;
$(function(){
if(startScript){
if($(captchaLoc).length > 0){
alert(captchaTxt);
$(captchaLoc).focus().css('border', '2px solid red');
return false;
}else{
if($('#50').length > 0){
$('#50').attr('checked', true);
$('form').attr('id', buyExtraVote);
$('#'+buyExtraVote).submit();
}else{
$('form').attr('id', voteFormLoc);
if($(voteBy).length > 0){
$(voteBy).attr('checked', true);
setTimeout("$('#"+voteFormLoc+"').submit()", 2000);
}else if($(voteDefault).length > 0){
$(voteDefault).attr('checked', true);
setTimeout("$('#"+voteFormLoc+"').submit()", 2000);
}else{
if($(simpatyFormId).length > 0){
if($(captchaLoc).length > 0){
alert(captchaTxt);
$(captchaLoc).focus().css('border', '2px solid red');
return false;
}else{
$(simpatyFormId).submit();
formProcessedAlready = true;
}
}else{
formProcessedAlready = true;
}
}
}
}
if(formProcessedAlready){
self.close();
}
}
});
, :
1) URL- ()
2) ,
3)
4) ()
5)
6) , ()
?