4chan /b/ post ID fix – Jetpack Script

Install this script now

/*
 * @name 4chan /b/ post ID fix
 * @description Fixes the post IDs on 4chan's /b/ board to display fully.
 */

jetpack.future.import("pageMods");

function callback(doc) {
    var idnodes = doc.querySelectorAll(".quotejs+.quotejs");
    for(var i in idnodes) {
        var idnode = idnodes[i];
        var r = /javascript:quote\('(\d+)'\)/.exec(idnode.href);
        if(r != null) {
            idnode.textContent = r[1];
        } else {
            r = /#q(\d+)/.exec(idnode.href);
            if(r != null) {
                idnode.textContent = r[1];
            }
        }
    }
}

jetpack.pageMods.add(callback, {matches: ["http://boards.4chan.org/b/*"]});

Back