edit/remove onsite script using imacros

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
lukasz
Posts: 33
Joined: Fri Jan 24, 2020 10:26 am

edit/remove onsite script using imacros

Post by lukasz » Tue Feb 02, 2021 6:37 pm

Computer System - WINDOWS 10 64 bit
Browser - Pale moon 28.8.0 64bit
Imacros extension 8.9.7

I need your help, First of all I don't know if it is possible at all but the javascript capabilities are quite extensive so I hope it can be done.
I need to edit or delete the script on the website
Of course, I can export its content and change it outside the site, the problem is that I don't know how to make changes to the site.

here is the script I need to change / remove:

Code: Select all

<script type="text/javascript">
    var onloadCallback = function () {
        grecaptcha.render('dvCaptcha', {
            'sitekey': '6LdSg0YaAAAAANXhEwEZ2HgDdcGWGnXYppcfoswq',
        'callback': function (response) {
            $.ajax({
                type: "POST",
                url: "Default.aspx/VerifyCaptcha",
                data: "{response: '" + response + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (r) {
                    var captchaResponse = jQuery.parseJSON(r.d);
                    //alert(captchaResponse.success);
                    if (captchaResponse.success) {
                        $("[id*=txtCaptcha]").val(captchaResponse.success);
                        $("[id*=rfvCaptcha]").hide();
                    } else {
                        $("[id*=txtCaptcha]").val("");
                        $("[id*=rfvCaptcha]").show();
                        var error = captchaResponse["error-codes"][0];
                        $("[id*=rfvCaptcha]").html("RECaptcha error. " + error);
                    }
                }
            });
        }
    });
    };
</script>

So as I wrote, there are two options

1 complete removal of this script.
or
2. change in script:

Code: Select all


                        $("[id*=txtCaptcha]").val("");
                        $("[id*=rfvCaptcha]").show();
                        var error = captchaResponse["error-codes"][0];
                        $("[id*=rfvCaptcha]").html("RECaptcha error. " + error);
into:

Code: Select all

                        $("[id*=txtCaptcha]").val(captchaResponse.success);
                        $("[id*=rfvCaptcha]").hide();
Is it possible ?
Post Reply