LOLZ_Remove_Game_Icons_In_Market

Remove game icons in Market

  1. // ==UserScript==
  2. // @name LOLZ_Remove_Game_Icons_In_Market
  3. // @namespace LOLZ_Remove_Game_Icons_In_Market
  4. // @version 0.1
  5. // @description Remove game icons in Market
  6. // @author el9in
  7. // @match https://lzt.market/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=zelenka.guru
  9. // @grant none
  10. // @license el9in
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. function init() {
  16. const elements_threads = document.querySelectorAll('.steamGameIcon--div');
  17. elements_threads.forEach(function(element) {
  18. element.remove();
  19. });
  20. }
  21.  
  22. async function ones(element) {
  23. const addedNodeClass = element.classList;
  24. if(addedNodeClass.contains("marketIndexItem")) {
  25. const elements_threads = document.querySelectorAll('.steamGameIcon--div');
  26. elements_threads.forEach(function(element) {
  27. element.remove();
  28. });
  29. }
  30. }
  31.  
  32. const observer = new MutationObserver((mutationsList, observer) => {
  33. for (const mutation of mutationsList) {
  34. if (mutation.type === 'childList') {
  35. mutation.addedNodes.forEach(addedNode => {
  36. if (addedNode.nodeType === Node.ELEMENT_NODE) {
  37. ones(addedNode);
  38. }
  39. });
  40. }
  41. }
  42. });
  43.  
  44. const config = { childList: true, subtree: true };
  45. observer.observe(document.body, config);
  46.  
  47. init();
  48. })();