Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery queue in Chrome userscript with popups?
    primarykey
    data
    text
    <p>I would like to ask if it is possible to build Chrome or Greasemonkey script witch could open all popups in queue. So far i have 2 seperate scripts for this, but that is not working well since popups have anti-spam feature that don't allow too much of them at the same time.</p> <p>What i would like to do is to process array of popup links in queue fashion and only open next when previous is closed. I have no expirience when it goes down to queues and any kind of event binding.</p> <p>So resources i got:</p> <p>1) Array of links already prepared</p> <pre><code>var URL_Array = []; $('form[name="form_gallery"] .img img').each(function(i,e){ // Format URL array here 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; } }); </code></pre> <p>2) Script that votes on image in popup</p> <pre><code> /*######################################################*/ var voteBy = '#vte_mark_12'; // Prefered vote icon var voteDefault = '#vte_mark_5'; // Default vote icon var voteFormLoc = 'image_voting'; // Image voting popups form var buyExtraVote = 'image_voting_buy'; // If run out of votes buy more var captchaLoc = 'input[name="captcha"]'; // Captcha input field var captchaTxt = 'Enter captcha text!'; // Captcha alert text var simpatyFormId = '#sym_send'; // Simpaty window form var startScript = true; var formProcessedAlready = false; // Used to check if image already was voted /*######################################################*/ $(function(){ if(startScript){ if($(captchaLoc).length &gt; 0){ alert(captchaTxt); $(captchaLoc).focus().css('border', '2px solid red'); return false; }else{ if($('#50').length &gt; 0){ $('#50').attr('checked', true); $('form').attr('id', buyExtraVote); $('#'+buyExtraVote).submit(); }else{ $('form').attr('id', voteFormLoc); if($(voteBy).length &gt; 0){ $(voteBy).attr('checked', true); setTimeout("$('#"+voteFormLoc+"').submit()", 2000); }else if($(voteDefault).length &gt; 0){ $(voteDefault).attr('checked', true); setTimeout("$('#"+voteFormLoc+"').submit()", 2000); }else{ // If we have simpaty box autocast submit if($(simpatyFormId).length &gt; 0){ if($(captchaLoc).length &gt; 0){ alert(captchaTxt); $(captchaLoc).focus().css('border', '2px solid red'); return false; }else{ $(simpatyFormId).submit(); formProcessedAlready = true; } }else{ formProcessedAlready = true; } } } } if(formProcessedAlready){ self.close(); } } }); </code></pre> <p>As far as i can understand it should go like this:<br/> 1) <strong>Get all unvoted urls and form array</strong> (done)<br/> 2) Queue all popups to open<br/> 3) Start first popup<br/> 4) <strong>Voting done and popup closes</strong> (done)<br/> 5) Start second popup<br/> 6) <strong>When array finished switch to next page</strong> (done)<br/></p> <p>What you think?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload