serpFilter

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

Versione datata 08/01/2021. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

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

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

    if (document.location.hostname.includes('yandex')) {
        snippet_id = 'li.serp-item';
        link_id = 'a.link';
    }
    else if (document.location.hostname.includes('google')) {
        snippet_id = 'div.g';
        link_id = 'a';
    };

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

    remove_crap();
})();