Tip jar

If you like CaB and wish to support it, you can use PayPal or KoFi. Thank you, and I hope you continue to enjoy the site - Neil.

Buy Me a Coffee at ko-fi.com

Support CaB

Recent

Welcome to Cook'd and Bomb'd. Please login or sign up.

March 28, 2024, 08:19:47 PM

Login with username, password and session length

CaB blocking tool - does a Firefox version exist?

Started by canadagoose, July 30, 2020, 03:07:11 PM

Previous topic - Next topic

canadagoose

And if so, where is it? I found an old thread which advised people to download the "Goldfinger extension" but I can't find it, and wasn't there something about Greasemonkey you had to install as well? What's the latest on this?

Famous Mortimer

I want to say...Zetetic programmed it? I know NoSleep has / had it too.

First things first, download Greasemonkey for your browser. That will allow you to enter and run your own scripts (like changing every picture of Donald Trump you may encounter on any website to that of a kitten). Then, you'll grab the script for the blocking tool from someone on here when they notice this thread, save it and run it.

Actually, those instructions seem pretty bad. I'll leave it to someone else to explain better.

canadagoose

Quote from: Famous Mortimer on July 31, 2020, 05:51:02 PM
I want to say...Zetetic programmed it? I know NoSleep has / had it too.

First things first, download Greasemonkey for your browser. That will allow you to enter and run your own scripts (like changing every picture of Donald Trump you may encounter on any website to that of a kitten). Then, you'll grab the script for the blocking tool from someone on here when they notice this thread, save it and run it.

Actually, those instructions seem pretty bad. I'll leave it to someone else to explain better.
Thanks, I've installed that now. Hopefully someone will know where to get the tool too.

earl_sleek

https://userscripts-mirror.org/scripts/show/177279 is the only place I can find Zetetic's Greasemonkey script, though it's about 5 years old now so no idea if it works.

Paul Calf adapted it into a Chrome extensions which you can get at https://github.com/Dazzla/goldfinger, but again no idea if it still works.

Ferris

Still can't get the fucker for safari so apple twats like me are stuck with everyone.

earl_sleek

Tampermonkey and other Greasemonkey alternatives appear to be available for Safari. (I'm an Apple twat too, but I use Firefox.)

Endicott

this works in tampermonkey in chrome, not tested in ff


// ==UserScript==
// @name        Ignore Users on Cook'd and Bomb'd V4
// @namespace   http://www.stupidpupil.co.uk
// @include     https://www.cookdandbombd.co.uk/forums/*
// @include     http://www.cookdandbombd.co.uk/forums/*
// @grant       none
// @version     1.4
// ==/UserScript==
(function () {
        'use strict';

        var ignoredUsers, expireAfter, opacity;

        expireAfter = 1209600000; //Milliseconds
        opacity = '0.3';

        console.log('running');

        ignoredUsers = window.localStorage.getItem("ignoredUsers");
        if (ignoredUsers) {
            console.log(ignoredUsers);
            ignoredUsers = JSON.parse(ignoredUsers);
        } else {
            ignoredUsers = {};
        }

        //

        function expireIgnores() {
            var ignore, i;

            for (i in ignoredUsers) {
                ignore = ignoredUsers[i];

                if ((Date.now() - ignore.ignored) > expireAfter) {
                    unignoreUser(i);
                }
            }
        }

        function ignoreUser(uid, username) {
            ignoredUsers[uid] = {
                'username': username,
                'ignored': Date.now()
            };
            console.log('set ignore list  - add user');
            window.localStorage.setItem("ignoredUsers", JSON.stringify(ignoredUsers));
        }

        function unignoreUser(uid) {
            delete ignoredUsers[uid];
            console.log('set ignore list  - remove user');
            window.localStorage.setItem("ignoredUsers", JSON.stringify(ignoredUsers));
        }


        //

        function setIgnoreLink() {
            if (!window.location.search.match("action=profile;u=")) {
                return false;
            }
            var infolinks, anchor, uid;
            infolinks = document.getElementById("infolinks");
            anchor = document.getElementById("ignorelink");
            uid = window.location.search.replace(new RegExp(".+;u=(\\d+)"), "$1");


            if (anchor) {
                anchor.childNodes[0].remove();
            } else {
                anchor = document.createElement("a");
                anchor.setAttribute("href", "#ignorelink");
                anchor.setAttribute("id", "ignorelink");

                anchor.addEventListener("click", function () {
                    var cuid, username;
                    cuid = window.location.search.replace(new RegExp(".+;u=(\\d+)"), "$1");
                    username = document.getElementsByClassName("username")[0].textContent.trim();


                    if (ignoredUsers[cuid]) {
                        unignoreUser(cuid);
                    } else {
                        ignoreUser(cuid, username);
                    }

                    setIgnoreLink();
                    return false;
                });

                infolinks.appendChild(document.createElement("br"));
                infolinks.appendChild(anchor);
            }


            if (ignoredUsers[uid]) {
                anchor.appendChild(document.createTextNode("Unignore User"));
            } else {
                anchor.appendChild(document.createTextNode("Ignore User"));
            }

        }

        //

        function hideThreads() {
            console.log('hideThreads - begin');
            if (!window.location.href.match("board")) {
                return false;
            }
            console.log('hideThreads - continue');

            var subjects, subject, uid, i;
            subjects = document.getElementsByClassName('subject');
            for (i in subjects) {
                subject = subjects[i];
                if (typeof subject === 'object') {
                    if (subject.getElementsByTagName("p").length > 0) {
                        uid = subject.getElementsByTagName("p")[0].getElementsByTagName("a")[0].href.replace(new RegExp(".+u=(\\d+)"), "$1");
                        if (ignoredUsers[uid]) {
                            subject.parentNode.style.opacity = opacity;
                            if (subject.getElementsByTagName("span")) {
                                subject.getElementsByTagName("span")[0].style.display = "none";
                                subject.parentNode.getElementsByClassName("stats")[0].textContent = "";
                                subject.parentNode.getElementsByClassName("lastpost")[0].textContent = "";
                            }

                        }
                    }
                }
                else {
                    break;
                }
            }
            console.log('hideThreads - end');
        }

        function hidePostsAndPostsWithQuotes() {
            console.log('hidePosts - begin');
            if (!window.location.href.match("topic")) {
                return false;
            }
            console.log('hidePosts - continue');

            var posts, post, uid, i;
            var quoteheaders, qh, usernames, qusername, ignoreQuoted;

            usernames = [];
            for (i in ignoredUsers) {
                usernames.push(ignoredUsers[i].username);
            }

            posts = document.getElementsByClassName('post_wrapper');

            for (i in posts) {
                post = posts[i];
                if (post.getElementsByTagName) {
                    uid = post.getElementsByClassName("poster")[0].getElementsByTagName("h4")[0].getElementsByTagName("a")[0].href.replace(new RegExp(".+u=(\\d+)"), "$1");
                    ignoreQuoted = false;

                    quoteheaders = post.getElementsByClassName('quoteheader');
                    for (i in quoteheaders) {
                        qh = quoteheaders[i];
                        if (qh.textContent) {
                            qusername = qh.textContent.replace(new RegExp("Quote from: (.+?) on .+"), "$1").trim();
                            if (usernames.indexOf(qusername) > -1) {
                                ignoreQuoted = true;
                            }
                        }
                    }

                    if (ignoredUsers[uid] || ignoreQuoted) {
                        post.parentNode.style.opacity = opacity;
                        setDisplayNone(post, "avatar");
                        setDisplayNone(post, "post");
                        setDisplayNone(post, "keyinfo");
                        setDisplayNone(post, "reset");
                        setDisplayNone(post, "moderatorbar");
                        setDisplayNone(post, "quote_button");
                    }

                }
            }
            console.log('hidePosts - end');
        }

        function hidePosts() {
            console.log('hidePosts - begin');
            if (!window.location.href.match("topic")) {
                return false;
            }
            console.log('hidePosts - continue');

            var posts, post, uid, i;
            posts = document.getElementsByClassName('post_wrapper');

            for (i in posts) {
                post = posts[i];
                if (post.getElementsByTagName) {
                    uid = post.getElementsByClassName("poster")[0].getElementsByTagName("h4")[0].getElementsByTagName("a")[0].href.replace(new RegExp(".+u=(\\d+)"), "$1");

                    if (ignoredUsers[uid]) {
                        post.parentNode.style.opacity = opacity;
                        setDisplayNone(post, "avatar");
                        setDisplayNone(post, "post");
                        setDisplayNone(post, "keyinfo");
                        setDisplayNone(post, "reset");
                        setDisplayNone(post, "moderatorbar");
                        setDisplayNone(post, "quote_button");
                    }

                }
            }
            console.log('hidePosts - end');
        }
        function setDisplayNone(post, name) {
            if (post.getElementsByClassName(name)[0]) {
                post.getElementsByClassName(name)[0].style.display = "none";
            }
        }

        function hideQuotes() {
            console.log('hideQuotes - begin');
            if (!window.location.href.match("topic")) {
                return false;
            }
            console.log('hideQuotes - continue');

            var quoteheaders, qh, usernames, qusername, i;
            quoteheaders = document.getElementsByClassName('quoteheader');

            usernames = [];
            for (i in ignoredUsers) {
                usernames.push(ignoredUsers[i].username);
            }

            for (i in quoteheaders) {
                qh = quoteheaders[i];
                if (qh.textContent) {
                    qusername = qh.textContent.replace(new RegExp("Quote from: (.+?) on .+"), "$1").trim();

                    if (usernames.indexOf(qusername) > -1) {
                        qh.nextSibling.textContent = "";
                        qh.nextSibling.style.opacity = opacity;
                        qh.style.opacity = opacity;
                    }
                }
            }
            console.log('hideQuotes - end');
        }


        //expireIgnores(); // removed because I want control
   
        //hideThreads(); // removed because I found it annoying
   
        setIgnoreLink();
   
        //hidePostsAndPostsWithQuotes();
   
        hidePosts();
        hideQuotes();
    }
)
();

canadagoose


imitationleather

Instead of going through all this just PM me the names of the posters you want to get rid of and I'll sort it for you.

earl_sleek

Quote from: imitationleather on August 04, 2020, 09:44:46 PM
Instead of going through all this just PM me the names of the posters you want to get rid of and I'll sort it for you.

Can you get rid of this poster for me please?

Famous Mortimer

Quote from: Endicott on August 04, 2020, 08:28:14 PM
this works in tampermonkey in chrome, not tested in ff


// ==UserScript==
// @name        Ignore Users on Cook'd and Bomb'd V4
// @namespace   http://www.stupidpupil.co.uk
// @include     https://www.cookdandbombd.co.uk/forums/*
// @include     http://www.cookdandbombd.co.uk/forums/*
// @grant       none
// @version     1.4
// ==/UserScript==
(function () {
        'use strict';

        var ignoredUsers, expireAfter, opacity;

        expireAfter = 1209600000; //Milliseconds
        opacity = '0.3';

        console.log('running');

        ignoredUsers = window.localStorage.getItem("ignoredUsers");
        if (ignoredUsers) {
            console.log(ignoredUsers);
            ignoredUsers = JSON.parse(ignoredUsers);
        } else {
            ignoredUsers = {};
        }

        //

        function expireIgnores() {
            var ignore, i;

            for (i in ignoredUsers) {
                ignore = ignoredUsers[i];

                if ((Date.now() - ignore.ignored) > expireAfter) {
                    unignoreUser(i);
                }
            }
        }

        function ignoreUser(uid, username) {
            ignoredUsers[uid] = {
                'username': username,
                'ignored': Date.now()
            };
            console.log('set ignore list  - add user');
            window.localStorage.setItem("ignoredUsers", JSON.stringify(ignoredUsers));
        }

        function unignoreUser(uid) {
            delete ignoredUsers[uid];
            console.log('set ignore list  - remove user');
            window.localStorage.setItem("ignoredUsers", JSON.stringify(ignoredUsers));
        }


        //

        function setIgnoreLink() {
            if (!window.location.search.match("action=profile;u=")) {
                return false;
            }
            var infolinks, anchor, uid;
            infolinks = document.getElementById("infolinks");
            anchor = document.getElementById("ignorelink");
            uid = window.location.search.replace(new RegExp(".+;u=(\\d+)"), "$1");


            if (anchor) {
                anchor.childNodes[0].remove();
            } else {
                anchor = document.createElement("a");
                anchor.setAttribute("href", "#ignorelink");
                anchor.setAttribute("id", "ignorelink");

                anchor.addEventListener("click", function () {
                    var cuid, username;
                    cuid = window.location.search.replace(new RegExp(".+;u=(\\d+)"), "$1");
                    username = document.getElementsByClassName("username")[0].textContent.trim();


                    if (ignoredUsers[cuid]) {
                        unignoreUser(cuid);
                    } else {
                        ignoreUser(cuid, username);
                    }

                    setIgnoreLink();
                    return false;
                });

                infolinks.appendChild(document.createElement("br"));
                infolinks.appendChild(anchor);
            }


            if (ignoredUsers[uid]) {
                anchor.appendChild(document.createTextNode("Unignore User"));
            } else {
                anchor.appendChild(document.createTextNode("Ignore User"));
            }

        }

        //

        function hideThreads() {
            console.log('hideThreads - begin');
            if (!window.location.href.match("board")) {
                return false;
            }
            console.log('hideThreads - continue');

            var subjects, subject, uid, i;
            subjects = document.getElementsByClassName('subject');
            for (i in subjects) {
                subject = subjects[i];
                if (typeof subject === 'object') {
                    if (subject.getElementsByTagName("p").length > 0) {
                        uid = subject.getElementsByTagName("p")[0].getElementsByTagName("a")[0].href.replace(new RegExp(".+u=(\\d+)"), "$1");
                        if (ignoredUsers[uid]) {
                            subject.parentNode.style.opacity = opacity;
                            if (subject.getElementsByTagName("span")) {
                                subject.getElementsByTagName("span")[0].style.display = "none";
                                subject.parentNode.getElementsByClassName("stats")[0].textContent = "";
                                subject.parentNode.getElementsByClassName("lastpost")[0].textContent = "";
                            }

                        }
                    }
                }
                else {
                    break;
                }
            }
            console.log('hideThreads - end');
        }

        function hidePostsAndPostsWithQuotes() {
            console.log('hidePosts - begin');
            if (!window.location.href.match("topic")) {
                return false;
            }
            console.log('hidePosts - continue');

            var posts, post, uid, i;
            var quoteheaders, qh, usernames, qusername, ignoreQuoted;

            usernames = [];
            for (i in ignoredUsers) {
                usernames.push(ignoredUsers[i].username);
            }

            posts = document.getElementsByClassName('post_wrapper');

            for (i in posts) {
                post = posts[i];
                if (post.getElementsByTagName) {
                    uid = post.getElementsByClassName("poster")[0].getElementsByTagName("h4")[0].getElementsByTagName("a")[0].href.replace(new RegExp(".+u=(\\d+)"), "$1");
                    ignoreQuoted = false;

                    quoteheaders = post.getElementsByClassName('quoteheader');
                    for (i in quoteheaders) {
                        qh = quoteheaders[i];
                        if (qh.textContent) {
                            qusername = qh.textContent.replace(new RegExp("Quote from: (.+?) on .+"), "$1").trim();
                            if (usernames.indexOf(qusername) > -1) {
                                ignoreQuoted = true;
                            }
                        }
                    }

                    if (ignoredUsers[uid] || ignoreQuoted) {
                        post.parentNode.style.opacity = opacity;
                        setDisplayNone(post, "avatar");
                        setDisplayNone(post, "post");
                        setDisplayNone(post, "keyinfo");
                        setDisplayNone(post, "reset");
                        setDisplayNone(post, "moderatorbar");
                        setDisplayNone(post, "quote_button");
                    }

                }
            }
            console.log('hidePosts - end');
        }

        function hidePosts() {
            console.log('hidePosts - begin');
            if (!window.location.href.match("topic")) {
                return false;
            }
            console.log('hidePosts - continue');

            var posts, post, uid, i;
            posts = document.getElementsByClassName('post_wrapper');

            for (i in posts) {
                post = posts[i];
                if (post.getElementsByTagName) {
                    uid = post.getElementsByClassName("poster")[0].getElementsByTagName("h4")[0].getElementsByTagName("a")[0].href.replace(new RegExp(".+u=(\\d+)"), "$1");

                    if (ignoredUsers[uid]) {
                        post.parentNode.style.opacity = opacity;
                        setDisplayNone(post, "avatar");
                        setDisplayNone(post, "post");
                        setDisplayNone(post, "keyinfo");
                        setDisplayNone(post, "reset");
                        setDisplayNone(post, "moderatorbar");
                        setDisplayNone(post, "quote_button");
                    }

                }
            }
            console.log('hidePosts - end');
        }
        function setDisplayNone(post, name) {
            if (post.getElementsByClassName(name)[0]) {
                post.getElementsByClassName(name)[0].style.display = "none";
            }
        }

        function hideQuotes() {
            console.log('hideQuotes - begin');
            if (!window.location.href.match("topic")) {
                return false;
            }
            console.log('hideQuotes - continue');

            var quoteheaders, qh, usernames, qusername, i;
            quoteheaders = document.getElementsByClassName('quoteheader');

            usernames = [];
            for (i in ignoredUsers) {
                usernames.push(ignoredUsers[i].username);
            }

            for (i in quoteheaders) {
                qh = quoteheaders[i];
                if (qh.textContent) {
                    qusername = qh.textContent.replace(new RegExp("Quote from: (.+?) on .+"), "$1").trim();

                    if (usernames.indexOf(qusername) > -1) {
                        qh.nextSibling.textContent = "";
                        qh.nextSibling.style.opacity = opacity;
                        qh.style.opacity = opacity;
                    }
                }
            }
            console.log('hideQuotes - end');
        }


        //expireIgnores(); // removed because I want control
   
        //hideThreads(); // removed because I found it annoying
   
        setIgnoreLink();
   
        //hidePostsAndPostsWithQuotes();
   
        hidePosts();
        hideQuotes();
    }
)
();

Works fine on FF for me.

earl_sleek

Yep, working for me in FF too :) Thanks Endicott!