Post
Topic
Board Meta
Re: Signature Adblock Script
by
kcud_dab
on 26/03/2015, 17:46:08 UTC
I don't trust your js code.
It's non human readable.

Share original source code.
Non humain readable ?

Code:
// ==UserScript==
// @name        bitcointalk adblock
// @namespace   grue
// @include     https://bitcointalk.org/index.php?topic=*
// @require     http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.3.min.js
// @grant       none
// @version     0.2.0
// @downloadURL https://bitcointalk.blob.core.windows.net/scripts/bct_adblock.user.js
// @updateURL   https://bitcointalk.blob.core.windows.net/scripts/bct_adblock.meta.js
// ==/UserScript==
function e(e) {
    for (var t = e.charCodeAt(), r = [
            [9472, 9583],
            [9600, 9631],
            [9632, 9727]
        ], n = 0; n < r.length; n++)
        if (t > r[n][0] && t <= r[n][1]) return !0;
    return !1
}

function t(r) {
    var n = Array.prototype.slice.call(r.childNodes),
        o = n.reduce(function(r, n) {
            if ($(n).attr("skip")) return r;
            if (1 == n.nodeType) return r + t(n);
            if (3 == n.nodeType) {
                var o = 0;
                for (c of n.nodeValue) e(c) && o++;
                var i = Number(getComputedStyle(n.parentNode).fontSize.match(/(\d*(\.\d*)?)px/)[1]);
                return r + i * i * o
            }
            return r
        }, 0);
    return o
}

function r(e) {
    var t = 0;
    return e.backgroundcolor ? 1 : (e.fontsize >= 14 && (t += .05 + Math.max(0, .02 * (e.fontsize - 14))), e.color && (t += .2), e.font && (t += .03), e.underline && (t += .05), e.bold && (t += .05), e.table && (t += .2), Math.min(t, 1))
}

function n(e, t) {
    var o = t;
    "undefined" == typeof t ? o = t = {} : t = $.extend({}, t);
    var i = Array.prototype.slice.call(e.childNodes);
    e.style["font-size"] && "inherit" != e.style["font-size"] && (t.fontsize = Number(e.style["font-size"].match(/(\d+)pt/)[1])), e.style.color && "inherit" != e.style.color && (t.color = !0), e.style["background-color"] && "inherit" != e.style["background-color"] && (t.backgroundcolor = !0), e.style["font-family"] && "inherit" != e.style["font-family"] && (t.font = !0), -1 != e.style["text-decoration"].indexOf("underline") && (t.underline = !0), "B" == e.tagName && (t.bold = !0), "TABLE" == e.tagName && (t.table = !0);
    var a = $(e).width() * $(e).height() * r(t) - $(e).width() * $(e).height() * r(o);
    return a += i.reduce(function(e, r) {
        return 1 == r.nodeType ? e + n(r, t) : e
    }, 0)
}

function o(e) {
    var r = 0;
    return r += t(e), r += n(e), r = Math.sqrt(r), $(e).find("a").length && (r *= 2), r > 100
}
for (var i = $("div .signature"), a = 0; a < i.length; a++) o(i[a]) && $(i[a]).attr("style", "opacity: 0; pointer-events: none");
If you cannot read this, original source code wont change anything!