uBlockProtector icon indicating copy to clipboard operation
uBlockProtector copied to clipboard

NSFW! gaybeeg.info, netdna-storage.com

Open phineasmax opened this issue 9 years ago • 94 comments

Thanks for your update for gaybeeg.info. It works perfectly. But netdna-storage.com still detected adblock Example: http://netdna-storage.com/f/RLESMQXo/FX-FreshCollegeMeat.mp4.html 1

phineasmax avatar Apr 25 '17 10:04 phineasmax

same as gaybeeg.info but with a race condition.

uBlock-user avatar Apr 25 '17 11:04 uBlock-user

@uBlock-user Hum, I don't think it's race condition... I found the detection script, they got smarter this time... _blocked is now in a closure...

    (function() {
    	var _blocked = 0;

    	function injectScript(src) {
			var script = document.createElement('script');
			script.async = true;
			script.src = src;
			script.addEventListener('error', function () {
				_blocked++;
			});
			document.head.appendChild(script);
		}

		[
			'//www.adnetworkperformance.com/a/display.php?r=1151825'
		].map(function(src) {
			injectScript(src);
		});

		$(function(){
			if(_blocked > 0){
				$('.warning').show();
				$('.plan-footer-item').removeClass('btn--grid').removeAttr('data-href');
			} else {
				$('.plan-footer-item').each(function(i, el){
					$(el).attr('href', $(el).data('href')).removeAttr('data-href');
				});
			}
		});
    })();

jspenguin2017 avatar Apr 25 '17 13:04 jspenguin2017

_blocked is now in a closure...

Killing injectScript should work too, but it doesn't, can you justify that ?

uBlock-user avatar Apr 25 '17 14:04 uBlock-user

@uBlock-user As I said before, it's in a closure.

jspenguin2017 avatar Apr 25 '17 14:04 jspenguin2017

You said _blocked is in a closure, I'm talking about injectScript, if I use a.noAccess on it, it should break the script, instead nothing changes, and as it also happens it's the first thing that loads and the only script that loads from that domain.

uBlock-user avatar Apr 25 '17 14:04 uBlock-user

@uBlock-user Well, _blocked and injectScript are both in the closure.

jspenguin2017 avatar Apr 25 '17 14:04 jspenguin2017

Hum, I think patching Element.prototype.addEventListener would work... The Core has some design flaw, that needs to be fixed before we can proceed...

jspenguin2017 avatar Apr 25 '17 14:04 jspenguin2017

FYI jQuery 3.2.1 was recently released, shouldn't you update the version to the latest ?

uBlock-user avatar Apr 25 '17 14:04 uBlock-user

Link - http://blog.jquery.com/

uBlock-user avatar Apr 25 '17 14:04 uBlock-user

@uBlock-user OK, thanks for letting me know. I don't think there is any rush in updating it.

jspenguin2017 avatar Apr 25 '17 14:04 jspenguin2017

This line would break their detection, along with everything else. So no, it's definitely not race condition. We need to patch Core before we can properly implement this so it only break detection, this can take some time.

a.win.Element.prototype.addEventListener = null;

jspenguin2017 avatar Apr 25 '17 14:04 jspenguin2017

I really appreciate your works. That site might also have some kind of IP tracking along with adblock detector. Hope you guys can make it work.

phineasmax avatar Apr 25 '17 14:04 phineasmax

I suggested that because you mentioned The Core has some design flaw, so updating jQuery should patch the flaw too.

uBlock-user avatar Apr 25 '17 14:04 uBlock-user

@uBlock-user Well, I guess... But the flaw we need to patch doesn't have anything to do with jQuery. The flaw is the way element properties are processed, we need to loop that so we can handle an arbitrarily deep property.

jspenguin2017 avatar Apr 25 '17 14:04 jspenguin2017

OK, I hacked a solution together, this should do the job until we can properly fix it. It is added to Script

if (a.domCmp(["netdna-storage.com"])) {
    //Temporary fix
    //Need to patch Core so this works: 
    //a.filter("Element.prototype.addEventListener", "error");
    const _createElement = a.doc.createElement;
    a.doc.createElement = function (what) {
        if (what === "script") {
            let elem = _createElement.apply(a.doc, arguments);
            elem.addEventListener("error", function (e) {
                e.stopPropagation();
            });
            return elem;
        } else {
            return _createElement.apply(a.doc, arguments);
        }
    };
}

jspenguin2017 avatar Apr 25 '17 15:04 jspenguin2017

Unfortunately, no change on my end.

uBlock-user avatar Apr 25 '17 15:04 uBlock-user

It's working for me... image

jspenguin2017 avatar Apr 25 '17 15:04 jspenguin2017

uBlock-user avatar Apr 25 '17 15:04 uBlock-user

What's your Script version? Can you dump debug log?

jspenguin2017 avatar Apr 25 '17 15:04 jspenguin2017

v6.187

uBlock-user avatar Apr 25 '17 15:04 uBlock-user