uBlockOrigin / uAssets

Resources for uBlock Origin, uMatrix: static filter lists, ready-to-use rulesets, etc.
GNU General Public License v3.0
4.12k stars 767 forks source link

apkmirror.com detects adblocking #764

Closed josephcsible closed 7 years ago

josephcsible commented 7 years ago

Replace the bracketed [...] placeholders with your own information.

URL(s) where the issue occurs

https://www.apkmirror.com/apk/google-inc/pixel-launcher/pixel-launcher-p-4275643-release/pixel-launcher-p-4275643-android-apk-download/

Describe the issue

When going to any download page on apkmirror.com, it detects ad blocking and makes you wait 10 seconds before downloading.

Versions

Settings

Notes

The responsible code:

    var ranTwice = false;

    function RzFOZJCiWS() {
        var visibleAds = 0;
        jQuery(".gooWidget > .adsbygoogle" ).each(function( i ) {
            if (jQuery(this).is(':visible') && jQuery(this).children().length > 0) {
                visibleAds += 1;
            }
        });
        console.log("Visible ads: " + visibleAds);

        var canRunAds = false;
        if(visibleAds >= 2) { canRunAds = true; } else { canRunAds = false;}

        if(jQuery(".downloadButton").length > 0) {
            if(canRunAds == true)
            {
                jQuery(".downloadButton").removeClass("disabled");
            }
            else
            {
                var elapsedTime = 0;
                var totalTime = 15;
                jQuery(".downloadButton").addClass("disabled");
                jQuery(".downloadCountdown").show();

                //Ad blocker is running for sure, show the countdown
                var timerInterval = setInterval(function() {
                    elapsedTime += 1;
                    var timeLeft = totalTime - elapsedTime;

                    jQuery("#secondsLeft").text(timeLeft);

                    if(timeLeft == 1)
                    {
                        jQuery("#secondsPlural").text("second");
                    }
                    else
                    {
                        jQuery("#secondsPlural").text("seconds");
                    }

                    if(elapsedTime >= totalTime) {
                        elapsedTime = totalTime;
                        jQuery(".downloadCountdown").slideUp("slow");
                        jQuery(".downloadButton").removeClass("disabled");
                        clearInterval( timerInterval );
                    }

                }, 1000);

                jQuery("#downloadCountdownBar").width("100%");
            }

            if(canRunAds == false) {
                jQuery("#sidebar .latestWidget").css("margin-top", "0px");
            }

            if(canRunAds && !ranTwice)
            {
                ranTwice = true;
            }
        }
    }

    jQuery(window).load(function() { RzFOZJCiWS(); })

The function name (RzFOZJCiWS here) is different on every page load, so we can't filter based on it.

ghost commented 3 years ago

https://www.apkmirror.com/apk/microsoft-corporation/outlook/outlook-4-2123-2-release/microsoft-outlook-secure-email-calendars-files-4-2123-2-3-android-apk-download/

Screenshot(s)

Screen ![2021-06-26_082332](https://user-images.githubusercontent.com/57287308/123502831-e193f100-d657-11eb-8874-7aa7ce43c8a7.png)

Versions

Settings

Screen ![2021-01-22_100714](https://user-images.githubusercontent.com/57287308/105464158-c3395c00-5c99-11eb-965b-81215d8f7bec.png)
ghost commented 2 years ago

https://www.apkmirror.com/apk/telegram-fz-llc/telegram/telegram-8-2-7-release/telegram-8-2-7-android-apk-download/

![2021-12-03_153548](https://user-images.githubusercontent.com/94611448/144611201-d4dd0d6c-b24d-426c-ac08-109faee0d233.png) ![2021-12-03_153548](https://user-images.githubusercontent.com/94611448/144611780-0f125ca1-7a24-4641-bf75-94408485ae08.png) Screen
stephenhawk8054 commented 2 years ago

Anti-adblock again when opening in new Private Window/Incognito session.

URL: https://www.apkmirror.com/apk/samsung-electronics-co-ltd/app-booster/app-booster-2-5-00-9-release/app-booster-2-5-00-9-android-apk-download/

Screenshot ![image](https://user-images.githubusercontent.com/66517106/148908378-0efc9c2a-4ff3-4563-b6d6-abfe5feeba4f.png)
Configuration ```yaml uBlock Origin: 1.40.2 Firefox: 95 filterset (summary): network: 77730 cosmetic: 40462 scriptlet: 16395 html: 616 listset (total-discarded, last updated): default: ublock-filters: 30701-29, 39m ublock-badware: 3703-1, 39m ublock-privacy: 183-0, 39m ublock-abuse: 76-0, 39m ublock-unbreak: 1727-0, 39m easylist: 62858-582, 39m easyprivacy: 26617-482, 39m urlhaus-1: 6896-0, 39m plowe-0: 3684-2, 39m filterset (user): [empty] modifiedUserSettings: advancedUserEnabled: true modifiedHiddenSettings: [none] supportStats: launchToReadiness: 609 ms popupPanel: blocked: 18 ```

Proposed filters:

apkmirror.com##+js(set, countVisibleEl, noopFunc)
apkmirror.com##.ains
apkmirror.com##.OUTBRAIN
mapx- commented 2 years ago

I cannot reproduce the issue

stephenhawk8054 commented 2 years ago

I cannot reproduce the issue

Hmmm weird... It happens to me in both PC and mobile.

PC video: https://streamable.com/xs25sv

Mobile video: https://streamable.com/k4ntkt

Mobile configuration ```yaml uBlock Origin: 1.40.2 Firefox Mobile: 96 filterset (summary): network: 80138 cosmetic: 22117 scriptlet: 16427 html: 619 listset (total-discarded, last updated): default: ublock-filters: 30803-269, 3m ublock-badware: 3703-1, 3m ublock-privacy: 183-1, 3m ublock-abuse: 76-0, 3m ublock-unbreak: 1733-0, 3m adguard-mobile: 7062-173, 3m easylist: 62895-24235, 3m easyprivacy: 26619-489, 3m urlhaus-1: 7862-0, 3m plowe-0: 3684-2, 2m filterset (user): [empty] modifiedUserSettings: [none] modifiedHiddenSettings: [none] supportStats: launchToReadiness: 1057 ms popupPanel: blocked: 18 ```
mapx- commented 2 years ago

my fault: I have a custom filter from other tests which seems to work (but with some breakage..):

apkmirror.com##+js(aost, document.querySelector, inlineScript, 2)