Hide Hunt

Удаляет охоту на карте

目前为 2024-10-09 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Hide Hunt
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-10-10
  5. // @description Удаляет охоту на карте
  6. // @author Smaileri
  7. // @match https://www.heroeswm.ru/map.php*
  8. // @match https://www.lordswm.com/map.php*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=heroeswm.ru
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. function removeMapHuntBlockDiv() {
  18. const huntBlockDiv = document.getElementById('map_hunt_block_div');
  19. if (huntBlockDiv) {
  20. huntBlockDiv.remove();
  21. console.log('map_hunt_block_div removed.');
  22. }
  23. }
  24.  
  25. // MutationObserver to watch for changes in the DOM
  26. const observer = new MutationObserver(function(mutations) {
  27. mutations.forEach(function(mutation) {
  28. if (mutation.type === 'childList') {
  29. removeMapHuntBlockDiv();
  30. }
  31. });
  32. });
  33.  
  34. // Start observing the document for changes
  35. observer.observe(document.body, { childList: true, subtree: true });
  36.  
  37. // Also try to remove the div immediately on load
  38. window.addEventListener('load', removeMapHuntBlockDiv);
  39. })();