Simplify Fb Feed

Hide the top bar on Facebook

  1. // ==UserScript==
  2. // @name Simplify Fb Feed
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Hide the top bar on Facebook
  6. // @author @l1ackoder
  7. // @match *://www.facebook.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Function to hide elements by their CSS selectors
  15. function hideElements() {
  16. const selectors = [
  17. '[aria-label="Facebook"]', // Facebook logo
  18. '[aria-label="Home"]', // Home icon
  19. '[aria-label="Friends"]', // Friends icon
  20. '[aria-label="Watch"]', // Video icon
  21. '[aria-label="Groups"]', // Group icon
  22. '[aria-label="Marketplace"]', // Marketplace icon
  23. '[aria-label="Notifications"]' // Notification icon
  24. ];
  25.  
  26. selectors.forEach(selector => {
  27. const element = document.querySelector(selector);
  28. if (element) {
  29. element.style.display = 'none';
  30. }
  31. });
  32. }
  33.  
  34. // Run the function on page load
  35. window.addEventListener('load', hideElements);
  36.  
  37. // Also run it whenever the page dynamically updates (like in single-page apps)
  38. const observer = new MutationObserver(hideElements);
  39. observer.observe(document.body, { childList: true, subtree: true });
  40. })();