Hide Certain TYT Member's comments

目前為 2017-01-31 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name     Hide Certain TYT Member's comments
// @description:en  Simple script to hide an annoying TYT member's posts and comments.
// @include  https://tytnetwork.com*
// @require  https://code.jquery.com/jquery-2.1.3.min.js
// @version 0.0.1.20170131041642
// @namespace https://greasyfork.org/users/98831
// ==/UserScript==

function addJQuery(callback) {
    var script = document.createElement("script");
    script.setAttribute("src", "https://code.jquery.com/jquery-2.1.3.min.js");
    script.addEventListener('load', function() {
        var script = document.createElement("script");
        script.textContent = "(" + callback.toString() + ")();";
        document.body.appendChild(script);
    }, false);
    document.body.appendChild(script);
}

// load jQuery and execute the main function
addJQuery(main);

// The example below hides comments by member: dDErss.
// And let's face it why wouldn't you want to hide his self righteous drivel?
// If you want to hide comments from even some other pompous member, just copy and paste all three lines that contain 'dDErss'
// and then simply change the name from dDErss to the member you would also like to stop seeing comments from...
//
// Or to reverse thje process, delete all three lines containing a members name to allow for their comments to be seen again.
// Pretty simple stuff.

function main() {
    $('.x-comment-content-wrap:contains("dDErss")').hide();
    $('.children:contains("dDErss")').hide();
    $('.comment:contains("dDErss")').hide();

}

// It's not perfect, as I quickly typed it up while watching my toast brown one breakfast morning...
// But it gets the job done.
// And there's probably a more efficient way to write the script... and one day I'll look at it a bit more closely.
// But not today. LOL!