uBlockOrigin / uAssets

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

dobreprogramy.pl #312

Closed F4z closed 7 years ago

F4z commented 7 years ago

Google Chrome 57.0.2987.98 (64-bit) uBlock Origin 1.11.2

Default filter lists + POL: polskie filtry do Adblocka i uBlocka + POL: polskie filtry do uBlocka uzupelnienie

Ads leftovers and background ads - https://www.dobreprogramy.pl/

Screenshot ![image](https://cloud.githubusercontent.com/assets/11742596/23801719/6e4fdc84-05b1-11e7-879e-ce5652ab972f.png)


I think they use script to reinject hidden elements and to load background ads - https://static.dpcdn.pl/2017_03_10_1/assets/js/core.min.js

And probably this:

Code

! function (e) {
                function t() {
                    var e, t, n, o, i, r;
                    u.length < 1 || (e = document.documentElement, t = e.createShadowRoot(), n = document.createElement("style"), n.styleSheet ? n.styleSheet.cssText = u.join("\n") : n.appendChild(document.createTextNode(u.join("\n"))), o = Object.getOwnPropertyDescriptor(Element.prototype, "shadowRoot"), i = Function.prototype.call.bind(o.get), Object.defineProperty(Element.prototype, "shadowRoot", {
                        configurable: !0,
                        enumerable: !0,
                        get: function () {
                            var e = i(this);
                            return e == t ? null : e
                        }
                    }), t.appendChild(document.createElement("shadow")), r = t.appendChild(n), r.innerHTML.length < 1 && (t.querySelector("style").innerHTML = f))
                }

                function n(e, t) {
                    var n, o, i;
                    if (e) {
                        if (t) return u.push(e);
                        n = document.head || document.getElementsByTagName("head")[0], o = document.createElement("style"), o.type = "text/css", o.styleSheet ? o.styleSheet.cssText = e : o.appendChild(document.createTextNode(e)), i = n.appendChild(o), i.innerHTML.length < 1 && (o.innerHTML = e)
                    }
                }

                function o() {
                    var e, t, n, o = $(document.styleSheets);
                    for (e = 0; e < o.length; e++)
                        if (!o[e].href)
                            for (t = o[e].cssRules || o[e].rules, n = 0; n < t.length; n++) t[n].cssText && /:root.+display\:\s+?none\s+?!important;?/.test(t[n].cssText) && (o[e].disabled = !0, o[e].cssRules ? o[e].deleteRule(n) : o[e].removeRule(n), o[e].ownerNode && (o[e].ownerNode ? o[e].ownerNode.remove() : document.head.removeChild(o[e].ownerNode)))
                }
                var i, r, l, d, c, a, s, u, p, h, m, f, g, y;
                if (Dp.isMobile) return i.parentNode.removeChild(i);
                if (i = document.currentScript || document.scripts[document.scripts.length - 1], r = !1, l = 64, d = document.querySelector("#slide-menu"), c = function () {
                        return !!document.documentMode
                }(), a = Math.round(d.offsetWidth / 2), String.prototype.trunc = function (e) {
                        return this.substr(0, e - 1) + (this.length > e ? "..." : "")
                }, s = function (e, t, n) {
                        e.addEventListener ? e.addEventListener(t, n, !1) : e.attachEvent("on" + t, function () {
                            return n.call(e, window.event)
                })
                }, e.left || e.right || e.both || !e.url || (e.both = e.url), (e.both || e.left || e.right) && (s(window, "resize scroll", function () {
                        a = Math.round(d.offsetWidth / 2)
                }), s(d, "mouseover", function (t) {
                        var n, o, i;
                        return t = t || window.event, t.target = t.target || t.srcElement, null === t.pageX && null !== t.clientX && (n = document.documentElement, o = document.body, t.pageX = t.clientX + (n && n.scrollLeft || o && o.scrollLeft || 0) - (n && n.clientLeft || o && o.clientLeft || 0), t.pageY = t.clientY + (n && n.scrollTop || o && o.scrollTop || 0) - (n && n.clientTop || o && o.clientTop || 0)), "undefined" != typeof t.isTrusted && !t.isTrusted || t.target.id !== d.id ? (d.style.cursor = "auto", d.removeAttribute("title"), !1) : (i = e.name + " (reklama)\nKliknij, aby przejść do: ", !e.both || e.left || e.right ? e.left && t.pageX < a ? d.title = i + e.mask.trunc(l) : d.title = i + e.mask.trunc(l) : d.title = i + e.mask.trunc(l), void (d.style.cursor = "pointer"))
                }), s(d, "mouseout", function (e) {
                        return e = e || window.event, e.target = e.target || e.srcElement, "undefined" != typeof e.isTrusted && !e.isTrusted || e.target.id !== d.id ? !1 : (d.style.cursor = "auto", void d.removeAttribute("title"))
                }), s(d, "click", function (t) {
                        if (t = t || window.event, t.target = t.target || t.srcElement, null === t.pageX && null !== t.clientX) {
                            var n = document.documentElement,
                                o = document.body;
                            t.pageX = t.clientX + (n && n.scrollLeft || o && o.scrollLeft || 0) - (n && n.clientLeft || o && o.clientLeft || 0), t.pageY = t.clientY + (n && n.scrollTop || o && o.scrollTop || 0) - (n && n.clientTop || o && o.clientTop || 0)
                }
                        return "undefined" != typeof t.isTrusted && !t.isTrusted || t.target.id !== d.id ? !1 : !e.both || e.left || e.right ? e.left && t.pageX < a ? (r || ga("send", "event", "Screening", "ClickLeft", e.name), void (window.location.href = e.left)) : (r || ga("send", "event", "Screening", "ClickRight", e.name), void (window.location.href = e.right)) : (r || ga("send", "event", "Screening", "Click", e.name), void (window.location.href = e.both))
                })), c) return i.parentNode.removeChild(i);
                for (u = [], p = [".wp-player", "#phContent_divQR", "body > form > #slide-menu > :empty", ".count-to", ".gamescarousel-wrapper", "#panReklama > div", "#phContent_avastBadge", ".forum-help-cta", '[style="width: 300px; margin: auto;"]', '[style="height: 150px; width: 630;"]', 'div[style="color: #A9A9A9; text-align:center;font-size:11px;"]', '[id$="_divAdTop"]', '.list.block-content > div[style$="height: 180px; width: 630;"]', '.block > div[style$="height: 600px; width: 300;"]', '.page-element.center.target > div[style$="height: 250px; width: 970;"]', 'div[id="slide-menu"] > a[id][href="#"]', '#slide-menu > * div[id^="c"][style^="height:"][style*="width:"]:not([id^="cbox"]):not([id="colorbox"])', "div#slide-menu > [id]:not([class]):not([style])", '.page-element.center.target[style="max-width:980px;margin:0px auto 30px auto;"]', 'img[src="http://delivery.way2traffic.com/campaign=21153/view/201561/count.gif?pb=14749&pc=825122&rd=1488278787"]'], h = document.styleSheets, m = "", g = "function" == typeof Element.prototype.createShadowRoot, y = 0; y < p.length; y++) m += (y > 0 ? ", " : " ") + (g ? "::content " : ":root ") + p[y];
                f = m + " { display: block !important; } " + (g ? "::content " : ":root ") + " .no-filter { display: table-row !important; }", n(f, !!g), g && t(), o(), $({
                    to: 0
                }).animate({
                    to: 1
                }, Math.floor(2e3 * Math.random()) + 1e3, function () {
                    return o()
                }), i.parentNode.removeChild(i)
            }({
                name: 'Viasat History - Ostatni Królowie - Wojownicy Europy 2017',
                both: 'http://pubads.g.doubleclick.net/gampad/clk?id=109296521&iu=/1040541/Screening',
                mask: 'http://ostatnikrolowie.pl'
            });

gorhill commented 7 years ago

They remove uBO's (or ABP's) injected CSS rules. The real problem is the the lack of user styles in Chromium. The page renders fine with Firefox, which supports real user styles.

F4z commented 7 years ago

Yes, in Firefox it looks fine, but background ad is still clickable.

okiehsch commented 7 years ago

dobreprogramy.pl##script:inject(abort-on-property-write.js, String.prototype.trunc) works on my end with Chrome and Firefox, but you would have to tell if this breaks something.

F4z commented 7 years ago

It works and it seems that it does not break anything. Thank you.

MajkiIT commented 7 years ago

Unfortunately the problem returned again. Can you look again? On FF is ok. On Chrome I see ads.

image

okiehsch commented 7 years ago

Does dobreprogramy.pl##script:inject(abort-on-property-read.js, Element.prototype.attachShadow) work for you? Edit: I assume you have default filter lists + POL: polskie filtry do Adblocka i uBlocka + POL: polskie filtry do uBlocka uzupelnienie

MajkiIT commented 7 years ago

@okiehsch Yes I have all of this filters. Yours rule Is OK. I will add to polish filters. Thanks.