Clicking js generated links in webbrowser control (C#)
<p>Im new to coding at all, and learning by doing some tricks.</p>

<p>I want to make that, when I open specific webpage, it generates links, and I want to auto click them as they are generated.</p>

<p>I can access html code from webbrowser, but I dont know how to do there anything with javascript. Even less I dont know much about js.
Is there anyone, who can help me do script, that clicks automatically on links generated by this JS script (as I understand, its "click_action" what Im interested in...):</p>

<pre><code>    if (!TeamChrome) {
    TeamChrome = {};
}
TeamChrome.currentMaxFeed = {};
TeamChrome.currentFeeds = {};
TeamChrome.feedFlourishFunction = null;

/*
 * getFeedBody
 * 
 * id - the id of the feed, e.g. 1234
 * el_id - the DOM id of the fed element we are putting this into, e.g. feed_1234
 * image - the url of an image icon to append to the feed item
 * message - the content of the feed item
 * action_text - the text of the action item
 * action_link - the url of the action_item to post an Ajax request to, e.g. services/response
 * prize_image - the image of a prize being awarded, if applicable
 * prize_name - the name of a prize being awarded, if applicable
 * source_type - user or system for creator of content
 * home_page - a boolean value specifying if this is going on the home page feed (and thus if we should show flourishes)
 */
TeamChrome.getFeedBody = function(id, el_id, image, message, action_text, action_link, prize_image, prize_name, source_type, home_page) {
    var feedBody = '';
    if (source_type != 'user' &amp;&amp; image != '') {
        if(message.indexOf("just changed their outfit! Do you like it?") != -1){
            feedBody += '&lt;div class="avatarSmallHeadshotChangedWrapper"&gt;&lt;div class="avatarSmallHeadshotChangedAvatarFeed"&gt;';
            if (image != '') {
                feedBody += '&lt;img src="' + image + '"/&gt;&lt;/div&gt;';
            } else {
                feedBody += '&amp;nbsp;';
            }
        }else{
            feedBody += '&lt;div class="play_feed_item_image"&gt;';
            if (image != '') {
                feedBody += '&lt;img src="' + image + '" width="32" height="32" /&gt;';
            } else {
                feedBody += '&amp;nbsp;';
            }
        }
        feedBody += '&lt;/div&gt;';
    }

    var flourish_message = message.match(/\[\*flourish_gift:(.+)\*\]/g);
    if (flourish_message) {
        if (bootup_complete &amp;&amp; home_page) {
            var callback_arg = flourish_message[0].replace(/\[\*flourish_gift:(.+)\*\]/g, '$1');
            flourishGift(document.getElementById('play_feed'), callback_arg);
        }
        message = message.replace(/\[\*flourish_gift:.+\*\]/g, '');
    }
    var flourish_points = message.match(/\[\*flourish_points_(\d+)\*\]/g);
    if (flourish_points) {
        if (bootup_complete &amp;&amp; home_page) {
            var callback_arg = flourish_points[0].replace(/\[\*flourish_points_(\d+)\*\]/g, '$1');
            flourishPoints(null, callback_arg);
        }
        message = message.replace(/\[\*flourish_points_(\d+)\*\]/g, '');
    }

    if(message.indexOf("just changed their outfit! Do you like it?") != -1){
       feedBody += '&lt;div class="play_feed_item_text" id="changedAvatarFeedText" style="padding-left:39px"&gt;'+message+'&lt;/div&gt;';
    }else{
       feedBody += '&lt;div class="play_feed_item_text"&gt;'+message+'&lt;/div&gt;';
    }

    if (prize_image != null &amp;&amp; prize_image != '' &amp;&amp; home_page) {
        feedBody += '&lt;div class="clear"&gt;&lt;/div&gt;';
        feedBody += '&lt;div class="award_wrapper"&gt;&lt;img src="' + prize_image + '" style="float:left" class="award_container" /&gt;&lt;div class="award_container_text"&gt;' + prize_name + '&lt;/div&gt;&lt;/div&gt;';
    }
    if (source_type == 'user') {
        feedBody += '&lt;div onmouseover="showReportExplain(event, this)" onmouseout="hideReportExplain()" onclick="reportFeedItem(\'' + el_id + '\', ' + id + '); logGameAction(\'report_feed\'); return false;" class="play_feed_item_report"&gt;!&lt;/div&gt;';
    }
    if (action_text != '') {
        callback = 'null';
        callback_arg = 'null';
        var click_action = '';

        var flourish_points = action_text.match(/\[\*flourish_points_(\d+)\*\]/g);
        if (flourish_points) {
            var callback = 'flourishPoints';
            var callback_arg = flourish_points[0].replace(/\[\*flourish_points_(\d+)\*\]/g, '$1');
            action_text = action_text.replace(/\[\*flourish_points_(\d+)\*\]/g, '');
        }

        var flourish_gift = action_text.match(/\[\*flourish_gift:(.+)\*\]/g);
        if (flourish_gift) {
            var callback = 'flourishGift';
            var callback_arg = flourish_gift[0].replace(/\[\*flourish_gift:(.+)\*\]/g, '$1');
            action_text = action_text.replace(/\[\*flourish_gift:(.+)\*\]/g, '');
        }

        var reload_operation = action_link.match(/\[\*reload_(.+)\*\]/g);
        if (reload_operation) {
            var callback = 'reloadGame';
            var callback_arg = reload_operation[0].replace(/\[\*reload_(.+)\*\]/g, '$1');
            action_link = '';//action_link.replace(/\[\*reload_(.+)\*\]/g, '');
        }

        var singleGiftPopup = action_link.match(/\[\*single_gift(.+)\*\]/g);
        if (singleGiftPopup) {
            var callback = 'singleGiftPopup';
            var callback_arg = singleGiftPopup[0].replace(/\[\*single_gift(.+)\*\]/g, '$1');
            action_link = '';
        }

        var learnMorePopup = action_text.match(/\[\*info(.+)\*\]/g);
        if(learnMorePopup){
            var callback = 'learnMorePopup';
            var callback_arg = learnMorePopup[0].replace(/\[\*info:(.+)\*\]/g, '$1');
            action_link = '';
            action_text = 'Learn More!';
        }
        if(learnMorePopup){
            click_action = 'learnMorePopup(event,\'' + callback_arg + '\'); return false;';
        }else{
            click_action = 'ajaxJump(this, ' + id + ', \'' + escape(action_link) + '\', ' + callback + ', \'' + escape(callback_arg) + '\');';
            var addFriendFeed = false;
            if(message.indexOf("needs friends to help them out") != -1){
                    addFriendFeed = true;
            }
            if(addFriendFeed){
                    click_action += "logGameAction('add_friend_from_Feed');";
            }
            click_action += "return false;";
        }

        if (click_action != '') {
            feedBody += '&lt;div id="play_feed_item_action_' + id + '" class="play_feed_item_action clear"&gt;&lt;a href="#" onclick="' + click_action + '"&gt;'+action_text+'&lt;/a&gt;&lt;/div&gt;';
        }
        //&lt;a href="#" onclick="loadProfile(this, event, 1008642263); return false;"&gt;ahahn4201&lt;/a&gt; &lt;img src="http://newdest-qa01.playdom.com:7771/images/playdomcom/ranks/icons12x12/rank6.png" class="rankFeedIcon" height="12" width="12"&gt; needs friends to help them out!


        //var singleGiftPopup = action_link.match(/\[\*single_gift(.+)\*\]/g);

    }

    feedBody += '&lt;div style="clear:both"&gt;&lt;/div&gt;';
    return feedBody;
};

/*
 * addFeed adds a feed item to a given container
 */
TeamChrome.addFeed = function(container_id, item_class, id, timestamp, image, header, message, action_text, action_link, prize_image, prize_name, source_type, home_page, is_heartbeat) {
    // Return if there is no body to the feed item
    if (message == '') return;

    // Reveal the container if it was previously hidden due to being empty
    $('#'+container_id).css('visibility','visible');

    // Create the feed item skeleton
    var feedDiv = document.createElement('div');
    feedDiv.className = item_class;
    feedDiv.id = item_class + '_' + id;

    // Feeds are initially hidden and graphically revealed when fetched via heartbeat
    if (is_heartbeat) {
        feedDiv.style.display = 'none';
    }

    id = parseInt(id);

    // Construct the actual body of the feed item via getFeedBody
    var feedHTML = '';
    if (header) {
        feedHTML += '&lt;div class="play_feed_item_header"&gt;' + header + '&lt;/div&gt;';
    }
    feedHTML += TeamChrome.getFeedBody(id, feedDiv.id, image, message, action_text, action_link, prize_image, prize_name, source_type, home_page);
    feedDiv.innerHTML = '&lt;div id="feedContent_' + id + '" class="homeFeedSource_' + source_type + '"&gt;' + feedHTML + '&lt;/div&gt;';

    // Only show the report inappropriate link for user-generated items
    if (source_type == 'user') {
        feedDiv.onmouseover = function() { showReportIcon(this); };
        feedDiv.onmouseout = function() { hideReportIcon(this); };
    }

    // Add the feed to the container and do a graphical reveal
    if ($('#'+container_id).children().length == 0) {
        $('#'+container_id).append(feedDiv);
    } else {
        $('#'+container_id).children().eq(0).before(feedDiv);
    }
    $('#'+feedDiv.id).slideDown('slow');

    // Mark this feed item as the new maximum timestamp so we don't iterate through stale items
    TeamChrome.currentMaxFeed[container_id] = timestamp;
    if (!TeamChrome.currentFeeds[container_id]) {
        TeamChrome.currentFeeds[container_id] = [];
    }
    TeamChrome.currentFeeds[container_id][TeamChrome.currentFeeds[container_id].length] = id;

    // Retire older feed items so that the DOM doesn't get cluttered with elements
    if (TeamChrome.currentFeeds[container_id].length &gt; 23) {
        var oldFeedID = TeamChrome.currentFeeds[container_id].shift();
        var oldFeed = document.getElementById(item_class + '_' + oldFeedID);
        if (oldFeed) {
            oldFeed.parentNode.removeChild(oldFeed);
        }
    }
};

// There is so much additional work involved in adding feed items, that we treat the
// addPriority action as a simple wrapper to the main function
TeamChrome.addPriorityFeed = function(id, timestamp, image, message, action_text, action_link, prize_image, prize_name, home_page, is_heartbeat) {
    TeamChrome.addFeed('play_priority_feed', 'play_priority_feed_item', id, timestamp, image, null, message, action_text, action_link, prize_image, prize_name, 'system', home_page, is_heartbeat);
    var previousBody = $('#play_priority_feed_item_' + id).html();
    previousBody += '&lt;div onclick="clearPriorityFeedItem(' + id + ')" class="play_feed_item_report"&gt;X&lt;/div&gt;';
    $('#play_priority_feed_item_' + id).html(previousBody);
    $('#play_priority_feed_item_' + id).mouseover(function() { showReportIcon(this); });
    $('#play_priority_feed_item_' + id).mouseout(function() { hideReportIcon(this); });
};
TeamChrome.updateTeamPoints = function(points) {
    $('.team_points_here').text(points);
};

// Deprecated
TeamChrome.lockChrome = function() {
    $('#play_competition_unlocked').hide(); 
    $('#play_competition_locked').show();   
};

// Deprecated
TeamChrome.unlockChrome = function(popup) {
    $('#play_competition_unlocked').show();
    $('#play_competition_locked').hide();   
    if (popup) {
        showUnlockPopup();
    }
};

TeamChrome.popupCallback = function(x, y, height, width) {
    return function(data) {
        createGenericPopup(data, x, y, height, width);
    };
};
TeamChrome.launchPopup = function(action, params, x, y, width, height) {
    var callback = TeamChrome.popupCallback(x, y, height, width);
    $.ajax({
        type: "POST",
        url: action,
        data: params,
        dataType: 'html',
        success: callback
    });
};
TeamChrome.xRelativeToContent = function(pageX, jQueryObj) {
    var left_pos = pageX - (jQueryObj.width()/2) - $('#play_content').offset().left;
    if (left_pos &lt; 10) {
        left_pos = 10;
    }
    if (left_pos + jQueryObj.width() &gt; $('#play_content').width() - 10) {
        left_pos = $('#play_content').width() - jQueryObj.width() - 10;
    }
    return left_pos;
};
TeamChrome.yRelativeToContent = function(pageY, jQueryObj) {
    var top_pos = pageY - $('#play_content').offset().top;
    if (top_pos &lt; 10) {
        top_pos = 10;
    }
    if (top_pos + jQueryObj.height() &gt; $('#play_content').height() - 10) {
        top_pos = $('#play_content').height() - jQueryObj.height() - 10;
    }
    return top_pos;
}
</code></pre>
