• Fur Affinity Forums are governed by Fur Affinity's Rules and Policies. Links and additional information can be accessed in the Site Information Forum.

Main Site YCH, Adoptables and Reminder blocker

NcProductions

New Member
Hi fellas.

I made a script for FurAffinity that hides YCH, auctions, adoptables and reminders from the gallery page. Recently, In my personal opinion, FurAffinity has been bloated with YCH's and reminders. So I made this script, mainly for my self but I thought I might as well share it with you fellas who feels the same way.

I am an artists who enjoys doing personal work, so I do not have any desire to purchase work from other artists. It has been difficult for me to enjoy other artists work (Regular art that is), when they are being overshadowed by the mentioned types above.

If you are a regular customer of YCH's, Adoptables etc. Please ignore this thread.

I want to apologize if I have posted this thread in the wrong category. If so, please do move it to a correct category. I am also unsure if this thread violates any rules of the forum. Please do PM me, so I can correct this issue in any way.

Script Information
This script is made for Tampermonkey extension that is compatible with chrome and the chromium based Microsoft edge browser. The language is written in JavaScript, a client based language that runs on your browser.

This script is tested both on the classic and the modern theme. If you encounter any issues, do comment on this thread, with information on what theme, browser and version of the browser you are using.

This script is not perfect, but will hide the most submissions that contains the blacklisted word.

Requirements
Tampermonkey plugin extension
(Chrome and Edge)
Greasemonkey plugin extension (Firefox)

Future Plans
Possible plans to make this script available to Firefox browser through the greasemonkey plugin extension.
Done.

Customizable
You can change the values in the array with your own desired values. Like Scat, Vore etc. In the code, look up for // The desired values to be blocked array. Inside the array, you can add or remove values. You can read more about JavaScript arrays by clicking this text.

How to install
Chrome & Edge:
First, install Tampermonkey plugin extension. Once installed, click the Tampermonkey extension and select create new script. Then replace the code that comes by default with mine. Look at "The JavaScript Code" section.

Firefox:
Install Greasemonkey plugin extension. Once installed, click the Greasemonkey extension and select "new user script". Then replace the code that comes by default with mine. Look at "The JavaScript Code" section.

Update Log
  • Fixed an issue with the script when viewing a gallery on an user.
  • Improved UI for both classic and modern theme.
  • Added firefox support

Preview Images
Home page


Browse page


The JavaScript Code
For Tampermonkey - Chrome and Microsoft Edge
Code:
// ==UserScript==
// @name         Block YCH and Adopt submissions.
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Write values in a blacklist array to block submissions from rendering on the gallery page.
// @author       https://www.furaffinity.net/user/ncproductions/
// @match        https://www.furaffinity.net/*
// @grant        none
// ==/UserScript==
// ==UserScript==
// @name         Block YCH and Adopt submissions.
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Write values in a blacklist array to block submissions from rendering on the gallery page.
// @author       https://www.furaffinity.net/user/ncproductions/
// @match        https://www.furaffinity.net/*
// @match        http://www.furaffinity.net/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // The desired values to be blocked

    const blacklist = [

        'ych',

        'adopt',

        'adoptable',

        'adoptables',

        'auction',

        'adoption',

        'reminder'

    ];



    const theme = document.querySelector('body').getAttribute('data-static-path').split('/').pop();

    const page = document.querySelector('body').id;

    let header = null;

    let counter = 0;

    let output = null;



    const headerStyle = page == 'pageid-userpage' && theme === 'classic' ? 'filter:opacity(.66);' : 'font-size:15px;filter:opacity(.66);';



    // Home page and browse gallery/user gallery page

    if(page != 'pageid-userpage'){



        const galleries = document.querySelectorAll('.gallery');

        for(let i = 0; i < galleries.length; i++){



            switch(page){

                case 'pageid-frontpage':

                    header = theme === 'classic' ? galleries[i].closest('.old-table-emulation').querySelector('.head > *') : galleries[i].closest('section:not(.gallery)').querySelector('.section-header > *');

                    break;

                default:

                    header = theme === 'classic' ? document.querySelector('.fancy-pagination'): document.querySelector('.navigation, .submission-list > .aligncenter');

                    break;

            }



            counter = 0;



            let submission = galleries[i].querySelectorAll('.t-image');

            for(let sub = 0; sub < submission.length; sub++){



                let title = submission[sub].querySelector('figcaption a').getAttribute('title');

                title = title.toLowerCase();



                blacklist.forEach(block => {

                    if(title.includes(block)){

                        submission[sub].style.display = "none";

                        counter++;

                    }

                });



                switch(page){

                    case 'pageid-frontpage':

                        if((submission.length - 1) == sub && counter > 0) header.innerHTML = `${header.innerHTML} - <strong style="${headerStyle}">Blocked ${counter} Submissions</strong>`;

                        break;

                    default:

                        output = `<h4 class="aligncenter" style="text-align:center;filter:opacity(.66);"><strong>Blocked ${counter} submissions</strong></h4>`;

                        if((submission.length - 1) == sub && counter > 0) header.insertAdjacentHTML('beforebegin', output);

                        break;

                }



            }

        }



    // Viewing user home page

    } else {



        let data = {};



        let user = theme === 'classic' ? document.querySelector('.addpad.lead b') : document.querySelector('.user-profile-main .username span');

            user = user.innerText.substr(1).toLowerCase();



        let you = theme === 'classic' ? '#my-username': '#my-username';

            you = document.querySelector(you).innerText.substr(1).toLowerCase();



        if(theme != 'classic'){

            const regExp = /\(([^)]+)\)/;

            you = regExp.exec(you)[1];

            you = you.trim();

        }



        for(let sub in submission_data){

            let item = submission_data[sub];



            if(item.username.toLowerCase() === user){

                data[sub] = {

                    title: item.title,

                    user: item.username

                }

            }

        }



        const userGallery = document.querySelectorAll('#gallery-latest-submissions > figure');

        for(let i = 0; i < userGallery.length; i++){

            let id = userGallery[i];



            // User gallery rundown

            for(let el in data){

                if(el === userGallery[i].id.substr(4) && user != you){



                    let title = data[el].title.toLowerCase();

                    blacklist.forEach(block => {

                        if(title.includes(block)){

                            userGallery[i].style.display = "none";

                            counter++;

                        }

                    });



                }

            }

        }



        // Output counter

        let headers = theme === 'classic' ? '.maintable > tbody > tr > td > b' : '.userpage-section-left .section-header h2';

            headers = document.querySelectorAll(headers);



        let gallery = theme === 'classic' ? 'Latest Submissions' : 'Gallery';



        for(let i = 0; i < headers.length; i++){



            if(headers[i].innerText === 'Featured Submission' && user != you){

                let featuredTitle = theme === 'classic' ? headers[i].closest('.maintable').querySelector(' tbody > tr:nth-child(2) span') : headers[i].closest('.userpage-section-left').querySelector('.userpage-featured-title a');

                    featuredTitle = featuredTitle.innerText.toLowerCase();



                blacklist.forEach(block => {

                    if(featuredTitle.includes(block)){

                        const selector = theme === 'classic' ? '.maintable' : '.gallery_container';

                        headers[i].closest(selector).outerHTML = '';

                    }

                });

            }



            if(headers[i].innerText === gallery && counter > 0 && user != you){

                headers[i].innerHTML = `Gallery - <strong style="${headerStyle}">Blocked ${counter} submissions</strong>`;

            }

        }



    }


})();
 
Last edited:

Raever

Chaotic Neutral Wreckage
Im not trying to mess with the OG posters hard work. But Yeah. I was able to add tags and the script blocked most of them.

As a non-coder could you explain how you managed that so I can copy it and add my own? :p
 

barrelraer318

New Member
As a non-coder could you explain how you managed that so I can copy it and add my own? :p
I am sorry I am late responding. Im not used to checking the forums.... Normally I could never log in. FOr some reason my email address was finally accepted. o_O *shrugs*

I just changed the code already in place using the tampermonkey browser plugin's code editor. It is fairly easy.... Only thing, I dont think this is working for the new watched submissions list. Anyway...

IF you use the code editor built into tampermonkey.
There is a list starting short way down the code, roughly line 26.

" const blacklist = [ "

You will see items kind of like this

'reminder',

I just added new lines in there following the same coding scheme...

'example',

'blocked',

'pickles,'

'dirt,'

That was pretty much it.

It seems to work so far.

Im not so sure about the watched submissions gallery list. It is either randomly missing restricted tags or its just not working there. Works great in the browse list. The plugin will even show how many submissions per page were blocked at the top of the page list. Just not on watched submissions... Not sure. It was the same with the stock unmodified code as well.
 

Yastreb

Well-Known Member
I am sorry I am late responding. Im not used to checking the forums.... Normally I could never log in. FOr some reason my email address was finally accepted. o_O *shrugs*

I just changed the code already in place using the tampermonkey browser plugin's code editor. It is fairly easy.... Only thing, I dont think this is working for the new watched submissions list. Anyway...

IF you use the code editor built into tampermonkey.
There is a list starting short way down the code, roughly line 26.

" const blacklist = [ "

You will see items kind of like this

'reminder',

I just added new lines in there following the same coding scheme...

'example',

'blocked',

'pickles,'

'dirt,'

That was pretty much it.

It seems to work so far.

Im not so sure about the watched submissions gallery list. It is either randomly missing restricted tags or its just not working there. Works great in the browse list. The plugin will even show how many submissions per page were blocked at the top of the page list. Just not on watched submissions... Not sure. It was the same with the stock unmodified code as well.
Do the blocked words need to be in the title of the submission? This doesn't seem to work for blocking tags.
 
Top