commit 13b3d96f38e92fb2e35b217c28bad4c98ceb9d61 Author: zyphlar Date: Thu Jan 16 22:15:41 2020 +0000 Add new file diff --git a/hide-facebook-likes.js b/hide-facebook-likes.js new file mode 100644 index 0000000..09a0b30 --- /dev/null +++ b/hide-facebook-likes.js @@ -0,0 +1,68 @@ +// ==UserScript== +// @name Hide Facebook Likes/Reacts +// @version 1 +// @grant none +// @run-at document-start +// @match https://*.facebook.com/* +// @license GNU General Public License v3.0 only +// @supportURL https://gitlab.com/zyphlar/hide-facebook-likes +// @contributionURL https://gitlab.com/zyphlar/hide-facebook-likes +// @compatible firefox +// @namespace https://greasyfork.org/users/236588 +// @description Clean up your FB notification feed and news feed by hiding information about who's liked what. +// ==/UserScript== + + +// Hide Facebook Likes and Reacts +// Copyright (C) 2020 zyphlar +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + +"use strict"; + + +function hideReacts() { + setInterval(doReactHiding, 10000); +} + +function doReactHiding(){ + hideElementsBySelector("#fbNotificationsFlyout li[data-gt*='feedback_reaction_generic']"); // generic reaction notifications + hideElementsBySelector("div[data-testid='fbFeedStoryUFI/feedbackSummary']"); // reaction and share icons +} + +function hideElementById(id) { + var e = document.getElementById(id); + if (e) { + e.style = "display: none;"; + } +} + +function hideElementsByClassName(name) { + var e = document.getElementsByClassName(name); + for (var i=0;i