HoFF - Facebook Chat Offline Hide

Hides the Offline users from the Facebook Chat

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

Advertisement:

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.

(I already have a user style manager, let me install it!)

Advertisement:

// ==UserScript==
// @name        HoFF - Facebook Chat Offline Hide
// @namespace   hoff
// @include     https://www.facebook.com/*
// @grant       GM_getValue
// @grant       GM_setValue
// @version     0.1.3
// @description Hides the Offline users from the Facebook Chat
// ==/UserScript==
var callback = function () {
	console.log("HoFF Started :).");
	setInterval(function () {
		var get_chat_list = document.getElementsByClassName('_42fz');
		var chat_list = Array.prototype.slice.call(get_chat_list);
		for (index = 0; index < chat_list.length; index++) {
			var found = chat_list[index].getElementsByTagName('span');
			if (found.length === 0) {
				console.log(found);
				chat_list[index].hidden = true;
			}
		}
	}, 5000);
};

if (
document.readyState === "complete" || (document.readyState !== "loading" && !document.documentElement.doScroll)) {
	callback();
} else {
	document.addEventListener("DOMContentLoaded", callback);
}