Discussions » Development

finding the right scope, and exchange line in site script

§
Posted: 2019-08-21
Edited: 2019-08-21

finding the right scope, and exchange line in site script

Greetings!

I'd like to get rid of an anti-adblocker script on weather site www.kachelmann.com. The script is called function.js, and the function in question goes like this:

.
.
.

$(document).ready(function () {
.
.
.
    if ($('#paywall-account-type').attr('data-value') !== 'payaccount') {
        try {
            nx.cmd.push(function () {
                nx.trigger('rescan');
            });
        } catch(err) {};

        a457c035a6dd2ca7c69(function(ret, triggerText) {
            var adblocker = 'Unknown';

            if(ret) {
                adblocker = 'Enabled';
                var infocounter=0;
                $('.md').each(function() {
                    infocounter++;
                    $(this).css('background-color','#f7284b');
                    $(this).css('color','#ffffff');
                    $(this).css('height','100%');
                    $(this).css('font-size','13px');
                    $(this).removeAttr("data-nx-container");
                    if (!isGoogle()) {
                        $(this).html(adblock_txt);
                    }
                    else {
                        $(this).html(adblock_txt2);
                    }
                    if (infocounter>=2) {
                        return false;
                    }
                });
            }
            else {
                adblocker = 'Disabled';
            }
}
.
.
.

So the only thing necessary would be to either change

if ($('#paywall-account-type').attr('data-value') !== 'payaccount') { into if ($('#paywall-account-type').attr('data-value') === 'payaccount') {

or even

adblocker = 'Enabled'; into adblocker = 'Disabled';

The latter - change the value of variable adblocker - works splendidly in the Debugger, the page gets loaded.

So my questions are: How do I open, change and save the file function.js in greasemonkey or any other script loader under Firefox? How do I actually change the variable?

My background is in programming, just not web programming and javascript. By asking you, I am hoping to get by the overhead of having to learn an entire paradigm and programming language just to solve this penny and dime stuff.

Thanks for reading and helping, Schoepke

Post reply

Sign in to post a reply.