serpFilter

Remove crappy yandex zen (and any other sites) from yandex and google search results.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name           serpFilter
// @namespace      aumakua
// @version        1.2.0
// @description    Remove crappy yandex zen (and any other sites) from yandex and google search results.
// @description:ru Удаляет ссылки на Яндекс.Дзен (можно добавлять и другие сайты) из результатов поиска гугла и яндекса.
// @author         aumakua
// @license        MIT
// @match          *://*ya.ru/search*
// @match          *://*yandex.ru/search*
// @match          *://google.com/search*
// @match          *://www.google.com/search*
// @grant          none
// ==/UserScript==

(function () {
    'use strict';
    let snippet_id = '';
    const crap = ['zen.yandex.ru', 'zen.yandex.com', 'dzen.ru']; // you can add other crappy sites here

    if (document.location.hostname.includes('ya.ru') || document.location.hostname.includes('yandex.ru')) {
        snippet_id = 'li:has(div.organic)';
    }
    else if (document.location.hostname.includes('google')) {
        snippet_id = 'div.g';
    }

    const remove_crap = () => {
        const snippets = document.querySelectorAll(snippet_id);
        for (let snippet of snippets) {
            const links = snippet.querySelectorAll('a');
            something:
            for (let link of links) {
                for (let piece of crap) {
                    if (link.href.includes(piece)) {
                        snippet.style.display = 'none';
                        break something;
                    }
                }
            }
        }
    };

    remove_crap();
})();