Facebook comments tag cleaner

Deletes Facebook comments someone is tagged in, as these are usually of no interest whatsoever

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Facebook comments tag cleaner
// @namespace    http://mutux.org/
// @version      0.1
// @description  Deletes Facebook comments someone is tagged in, as these are usually of no interest whatsoever
// @author       Joakim
// @match http://*.facebook.com/*
// @match https://*.facebook.com/*
// @grant        none
// ==/UserScript==

do {
	var someRemoved = false;

	comments = document.getElementsByClassName("UFIComment");

	for (var i = 0; i < comments.length; i++) {

		comment = comments[i];
		text = comment.getElementsByClassName("UFICommentBody")[0];

		/* if (text.firstChild.className == "profileLink") { */
		if (text.getElementsByClassName("profileLink").length > 0) {

			comment.parentNode.removeChild(comment);
			someRemoved = true;
		}
	}
} while(someRemoved);