Hide Google Logo

Hide elements with class lnXdpd on Google.com

  1. // ==UserScript==
  2. // @name Hide Google Logo
  3. // @namespace http://your.namespace.com
  4. // @version 1.0
  5. // @description Hide elements with class lnXdpd on Google.com
  6. // @author Your Name
  7. // @match https://www.google.com/*
  8. // @grant none
  9. // @license ronengyattrizzelr
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Function to apply the style
  16. function applyStyle() {
  17. var elements = document.getElementsByClassName('lnXdpd');
  18. for (var i = 0; i < elements.length; i++) {
  19. elements[i].style.display = 'none';
  20. }
  21. }
  22.  
  23. // Wait for the page to load
  24. window.addEventListener('load', function() {
  25. // Apply the style
  26. applyStyle();
  27. });
  28.  
  29. // If the page content changes (due to AJAX or other dynamic updates), reapply the style
  30. var observer = new MutationObserver(function(mutations) {
  31. mutations.forEach(function(mutation) {
  32. if (mutation.type === 'childList') {
  33. applyStyle();
  34. }
  35. });
  36. });
  37.  
  38. // Start observing changes to the document
  39. observer.observe(document.body, {
  40. childList: true,
  41. subtree: true
  42. });
  43. })();