Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4565336
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:37:42+00:00 2026-05-21T18:37:42+00:00

I would like to ask if it is possible to build Chrome or Greasemonkey

  • 0

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.

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.

So resources i got:

1) Array of links already prepared

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;
    }
});

2) Script that votes on image in popup

    /*######################################################*/  
    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 > 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 we have simpaty box autocast submit
                    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();
        }
    }
});

As far as i can understand it should go like this:
1) Get all unvoted urls and form array (done)
2) Queue all popups to open
3) Start first popup
4) Voting done and popup closes (done)
5) Start second popup
6) When array finished switch to next page (done)

What you think?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T18:37:43+00:00Added an answer on May 21, 2026 at 6:37 pm
    • What are the exact URL’s of the main page(s) and also of the popups?
    • What version of jQuery are you using, and how are you including it?

    The exact URLs are important because the script needs to handle both the main pages and the popups and operate differently on each.

    Their are 2 main ways to handle this. Either:

    1. Use include directives to make sure that the script runs on both the main page and the popup, but switches its behavior depending on the page type. This will have two different instances of the script running simultaneously, which is not a problem.

    2. Use include and possibly exclude directives to ensure that the script only runs on the main page. Then have the popup-opening code manipulate the form.


    Here’s how to do approach 1:

    (1) Suppose the main pages were like:
        somewhere.com/main/*
        and the popup pages were like:
        somewhere.com/window/friend/gallery_view/*
        Make sure the script’s include-directives fire on both sets of pages.

    (2) Ensure that jQuery is available on both kinds of pages. jQuery 1.5.1 is recommended. jQuery 1.3.2 probably won’t work for the following code.

    (3) Then code like the following should work:

    var URL_Array   = [];
    var PopupQueue  = $({});    //-- jQuery on an empty object - a perfect queue holder
    
    //--- Is this a popup window or the main page?
    
    if ( /\/window\/friend\/gallery_view\//i.test (window.location.href) )
    {
        //--- This is a popup page
    
        /*######################################################*/  
        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 > 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 we have simpaty box autocast submit
                            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();
                }
            }
        });
    }
    else
    {   //--- This is a main page
    
        $('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;
            }
        });
    
        //--- Load up the queue.
        $.each (URL_Array, function (PopupNum, PopupURL) {
    
            PopupQueue.queue ('Popups', function (NextQ_Item) {
    
                OpenPopupFromQueue (NextQ_Item, PopupNum+1, PopupURL);
            } );
        } );
    
        //--- Launch the Popups, one at a time.
        PopupQueue.dequeue ('Popups');
    }
    
    
    function OpenPopupFromQueue (NextQ_Item, PopupNum, PopupURL)
    {
        var PopupWin    = window.open (PopupURL, "_blank");
        if (!PopupWin)
        {
            console.log ('Bad URL ' + PopupURL)
            setTimeout (function() { NextQ_Item (); }, 2003);
            return;
        }
    
        /*--- Only after the popup has loaded can we do any processing.
        */
        PopupWin.addEventListener (
            "load",
            function () {
                /*--- Setup the listener for when the popup has closed.
                    We fire the next popup from the queue, there.
                */
                PopupWin.addEventListener (
                    "unload",
                    function () {
                        PopupClosed (NextQ_Item);
                    },
                    false
                );
    
                /*--- We could process the popup here, but it's better to let another instance of this
                    script do it, instead.
                */
            },
            false
        );
    }
    
    
    function PopupClosed (NextQ_Item)
    {
        //--- Launch the next popup from the queue.
        NextQ_Item ();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to ask if it is possible to copy/move all the objects
I would like to ask if there is a possible way to select all
all. I would like to ask if it is possible to have multiple forms
I would like to ask if it is at all possible to let MySQL
I would like to ask you if is possible to add a shadow to
I would like to ask if is it possible to extract the exact variable
i would like to ask if it is possible to forbid pull-out of the
I'm a newbie in WPF and I would like to ask if it's possible
Possible Duplicate: JavaScript: Why the anonymous function wrapper? I would like to ask you
I would like to ask you which automated build environment you consider better, based

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.