Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kachelmannwetter.com needs defuser scriptlet #6092

Closed
TheRealCuran opened this issue Aug 15, 2019 · 30 comments
Closed

kachelmannwetter.com needs defuser scriptlet #6092

TheRealCuran opened this issue Aug 15, 2019 · 30 comments

Comments

@TheRealCuran
Copy link

URL(s) where the issue occurs

https://kachelmannwetter.com/de/wetter/2950159-berlin

Describe the issue

When loading any page on kachelmannwetter.com with an adblocker (uBlock Origin and uMatrix in my case) enabled you will get redirected to https://kachelmannwetter.com/de/site/adblockuser. The reason for this lurks in https://kachelmannwetter.com/js/function.js, lines 160ff:

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

            if(typeof ga !=='undefined'){
                ga('send', 'event', 'Adblocker', adblocker, { nonInteraction: true});
            } else if(typeof _gaq !=='undefined'){
                _gaq.push(['_trackEvent','Adblocker',adblocker,undefined,undefined,true]);
            }

            console.log({adblocker: adblocker, trigger: triggerText, isAdblockInfoSite: $('#noadblock-info').attr('data-value') === 'true'});

            var urlpath = get_url_path();
            if (urlpath.length == 0) { urlpath = '/'; }
            if (adblocker === 'Enabled' && $('#stop-redirect').attr('data-value') !== 'true' && $('#noadblock-info').attr('data-value') !== 'true' && !isGoogle()) {
                if(location.href.indexOf('adpreview=true') !== -1)
                    location.href = get_url_path()+'/site/adblockuser?adpreview=true';
                else
                    location.href = get_url_path()+'/site/adblockuser';
            }
            else if (adblocker === 'Disabled' && $('#noadblock-info').attr('data-value') === 'true' && !isGoogle()) {
                if(location.href.indexOf('adpreview=true') !== -1)
                    location.href = urlpath + '?adpreview=true';
                else
                    location.href = urlpath;
            }
            else if($('#stop-redirect').attr('data-value') !== 'true' && checkCookie() === 'cookiefail' && !isGoogle()) {
                showCookieFail();
            }
            else if ($('#nocookies-info').attr('data-value') === 'true' && checkCookie() !== 'cookiefail' && !isGoogle()) {
                location.href = urlpath;
            }

        });
    }

The easiest way to disable this is to set the attribute data-value of the HTML DOM element with the ID paywall-account-type to payaccount.

Versions

  • Browser/version: Firefox/68.0.2
  • uBlock Origin version: 1.21.2

Settings

Not a settings issue, see above.

Notes

I failed to implement the fix in a custom scriptlet myself, but when I execute

(function() {
    document.getElementById('paywall-account-type')
      .setAttribute('data-value', 'payaccount');
})();

as a Greasemonkey script the page is working as intended again, ie. no longer redirects to that ad block user page.

If that is possible, it might be an option to block that specific redirect. Or replace parts of functions.js. Otherwise this solution is possibly rather fragile. Though other options are visible from the code snippet posted above.

@mapx-
Copy link
Contributor

mapx- commented Aug 15, 2019

Did you update uBo lists ?

@TheRealCuran
Copy link
Author

TheRealCuran commented Aug 15, 2019

Yes, I could view the scriplet from uBo's resource viewer and it showed the same content as the version I had put on a server (which was basically the four line solution from my report plus the name and content type line above it). The file looked like this:

kachelmanwetter.com.js application/javascript
(function() {
    document.getElementById('paywall-account-type')
      .setAttribute('data-value', 'payaccount');
})();

uBo told me it was using five of five filters (which I guess meant lines in this context) from that file.

When I added a filter like kachelmannwetter.com##+js(kachelmanwetter.com.js) nothing happened. I even added an alert() to make sure I notice if the snippet triggers and it didn't.

But that isn't the purpose of this ticket. I just want to get the snippet (or something to similar effect) added to the official resource.txt as well as the accompanying entry in the filters.

@mapx-
Copy link
Contributor

mapx- commented Aug 15, 2019

The filter in uBo filters list still working for me:
kachelmannwetter.com##+js(sid, adsJsLoaded)

@TheRealCuran
Copy link
Author

Oh, the main filter was stuck on a two day old version, I see.

@asdfxD
Copy link

asdfxD commented Aug 21, 2019

Fixed, we need new bypass.

okiehsch added a commit that referenced this issue Aug 21, 2019
@uBlock-user
Copy link
Contributor

or you could just remove the attribute itself instead of adding another scriptlet --

kachelmannwetter.com##+js(ra, data-value)

@mapx-
Copy link
Contributor

mapx- commented Aug 21, 2019

cffb66a

@Prince-Kassad
Copy link

Doesn't work here. Updated scripts and the hardblock still triggers.

@mapx-
Copy link
Contributor

mapx- commented Aug 21, 2019

Do you see in the logger this last filter ?
cffb66a

@Prince-Kassad
Copy link

No. I only see the other two JS filters and ##dkpw-billboard-margin DOM filter but not this one.

@mapx-
Copy link
Contributor

mapx- commented Aug 21, 2019

well, just update your lists

@mapx-
Copy link
Contributor

mapx- commented Aug 21, 2019

or use:
kachelmannwetter.com,meteologix.com##+js(set-constant.js, requestAnimationFrame, trueFunc)

@mapx-
Copy link
Contributor

mapx- commented Aug 21, 2019

or

@@||tag.partner.mairdumont.com^$script,domain=kachelmannwetter.com
@@||tag.md-nx.com^$script,xhr,domain=kachelmannwetter.com

@Prince-Kassad
Copy link

kachelmannwetter.com,meteologix.com##+js(set-constant.js, requestAnimationFrame, trueFunc)

This line does the trick for me. The line from the commit just doesn't match, even if copied in as a custom filter. On the other hand, adding this as a custom filter works like a charm.

@mapx-
Copy link
Contributor

mapx- commented Aug 21, 2019

yeah, I used an abbreviation (set for set-constant ) which maybe is not in uBo stable yet (I use the last dev build)

mapx- added a commit that referenced this issue Aug 21, 2019
okiehsch added a commit that referenced this issue Aug 21, 2019
@KiLL4FuNK
Copy link

Anti-Adblock

@mapx-
Copy link
Contributor

mapx- commented Aug 27, 2019

update your lists

@uBlock-user
Copy link
Contributor

@TheRealCuran my set-attr scriptlet if you're looking for a working one -- https://github.com/uBlock-user/uBO-Scriptlets/blob/master/scriptlets.txt#L427

kachelmannwetter.com##+js(set-attr, data-value, payaccount, #paywall-account-type)

@TheRealCuran
Copy link
Author

Thanks I'll check that out; for now I've just implemented that solution as a Greasemonkey script, because the current rule set of uBlock no longer works for me. (I suspect I would have to unblock the ad domains in uMatrix, but that will never happen. I don't want to be tracked, if I can avoid it.)

@mapx-
Copy link
Contributor

mapx- commented Aug 31, 2019

for now the uBo filters are working. Remove any other custom filter for the site from "my filters"

@TheRealCuran
Copy link
Author

No, they are not working for myself.

I don't have any custom filters for kachelmann.com, yet I still get redirected to the anti ad-block page once I disable my Greasemonkey script.

The only custom settings I have is under "My rules":

no-remote-fonts: kachelmannwetter.com false
no-scripting: kachelmannwetter.com false

and neither should matter.

I also just purged my filters cache and reloaded to make sure I have the latest filter lists, still no luck. The filters I see are:

! https://github.com/uBlockOrigin/uAssets/issues/2883
! https://github.com/uBlockOrigin/uAssets/issues/6092
@@||kachelmannwetter.com/js/ads.js$script,1p
kachelmannwetter.com##.dkpw-billboard-margin
@@||tag.partner.mairdumont.com^$script,domain=kachelmannwetter.com
@@||tag.md-nx.com^$script,xhr,domain=kachelmannwetter.com

(I tested with disabled uMatrix as well and that didn't help either.)

The last idea I had was that another of the standard filter lists might interfere, so I deactivated all of them. But again: as soon as I disable my Greasemonkey script I get redirected to the anti ad-block page.

Just for reference, my Greasemonkey script looks like this:

// ==UserScript==
// @name        Defuse kachelmannwetter.com AdBlock detection
// @description New adblock "detection", fix it...
// @include     https://kachelmannwetter.com/*
// @version     0.1
// @grant       none
// ==/UserScript==

(function() {
    document.getElementById('paywall-account-type')
      .setAttribute('data-value', 'payaccount');
})();

@mapx-
Copy link
Contributor

mapx- commented Aug 31, 2019

tested in FF / chrome, default settings, no issue for me

@Prince-Kassad
Copy link

Confirming @TheRealCuran as it doesn't work for me either.

@TheRealCuran
Copy link
Author

I tried resetting my settings of uBlock. Still no lock with a vanilla uBlock.

These are my extensions. If you want me to test with one or all of them disabled, let me know.
image

@mapx-
Copy link
Contributor

mapx- commented Sep 1, 2019

Keep only uBo enabled and test again.

okiehsch added a commit that referenced this issue Sep 9, 2019
okiehsch added a commit that referenced this issue Sep 12, 2019
@martin54
Copy link

Solution for everybody, who has still problems:
In your own filter list, add the following line:
@@||securepubads.g.doubleclick.net/tag/js/gpt.js$script,domain=kachelmannwetter.com
This will "undo" a filter from EasyList (and others), which is causing problems on that site.

If this doesn't fix the problem:

Keep only uBo enabled and test again.

=> also deactivate all other filter lists except the uBlock-own lists.

@mapx-
Copy link
Contributor

mapx- commented Sep 12, 2019

it was already fixed hours ago

@martin54
Copy link

it was already fixed hours ago

Yes, it's working correctly, if the user has only the uBlock-own filter lists activated.
But if the user additionally has e.g. the EasyList selected, then it's not working any more.

@mapx-
Copy link
Contributor

mapx- commented Sep 12, 2019

It's working fine with last easylist list & last filters added in uBo lists

@theinstantmatrix
Copy link

Anti-Adblock Script at https://weather.us/

AdguardTeam/AdguardFilters#50937

okiehsch added a commit that referenced this issue Mar 5, 2020
uBlock-user added a commit that referenced this issue May 29, 2021
uBlock-user added a commit that referenced this issue Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants