Skip to content

Instantly share code, notes, and snippets.

@jdelamater99
Last active November 2, 2023 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdelamater99/a0149fffad51fbf451ffdd81723b4d13 to your computer and use it in GitHub Desktop.
Save jdelamater99/a0149fffad51fbf451ffdd81723b4d13 to your computer and use it in GitHub Desktop.
Hide "suggested for you" from wall
// ==UserScript==
// @name Hide Facebook Suggestions
// @namespace http://jdel.us
// @description Hide "suggested for you" from wall
// @include https://*.facebook.*
// @version 1.0
// @grant none
// ==/UserScript==
let suggestions = document.getElementsByClassName("x1lliihq");
let timer = 0;
timer = setTimeout(() => {
hideSuggestions();
}, 500);
window.addEventListener("scroll", hideSuggestions);
function hideSuggestions(){
for (let i=0; i<=suggestions.length; i++){
if (suggestions[i].innerHTML.search("Suggested for you") !== -1) {
suggestions[i].style.display = "none";
//suggestions[i].innerHTML = "<p>// Suggestion Removed //</p>";
}
}
if (timer) {
clearTimeout(timer);
timer = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment