Sower ID Filter

人狼物語@リア充で特定のIDの発言を非表示にします

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         Sower ID Filter
// @namespace    http://real.gunjobiyori.com/
// @version      0.1
// @description  人狼物語@リア充で特定のIDの発言を非表示にします
// @author       euro_s
// @match        http://real.gunjobiyori.com/sow.cgi*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // 非表示にしたいIDを設定してください。
    const FILTER_ID = ['nobumasa', '龍臣', 'ことら', 'nobusama'];

    // Your code here...
    function main() {
        const els = document.querySelectorAll('.message_filter div div:nth-child(2) .mesname');
        els.forEach((el) => {
            FILTER_ID.forEach((id) => {
                if (el.innerHTML.match(id)) {
                    el.parentElement.parentElement.parentElement.style.display = 'none';
                }
            });
        });
    }

    new MutationObserver(main).observe(
        document.querySelector('.inframe'), { childList: true }
    );

    main();
})();