Hide Spanish Language Div on Bloomberg

Hides divs with Spanish language section on bloomberg.com

  1. // ==UserScript==
  2. // @name Hide Spanish Language Div on Bloomberg
  3. // @description Hides divs with Spanish language section on bloomberg.com
  4. // @match https://www.bloomberg.com/*
  5. // @version 0.0.1.20250404070600
  6. // @namespace https://greasyfork.org/users/1435046
  7. // ==/UserScript==
  8.  
  9. (function() {
  10. 'use strict';
  11.  
  12. const observer = new MutationObserver(() => {
  13. const allDivs = document.querySelectorAll('div[data-component="grid-module"]');
  14.  
  15. allDivs.forEach(div => {
  16. const section = div.querySelector('section[data-canonical="spanish_language"]');
  17. if (section) {
  18. div.style.display = 'none';
  19. }
  20. });
  21. });
  22.  
  23. observer.observe(document.body, {
  24. childList: true,
  25. subtree: true
  26. });
  27. })();