useless_buttons

Удаляет в моб. версии боя при просмотре боя кнопку `вернуться назад` и `вернуться на страницу героя`

目前为 2025-04-11 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name useless_buttons
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.
  5. // @description Удаляет в моб. версии боя при просмотре боя кнопку `вернуться назад` и `вернуться на страницу героя`
  6. // @author Something begins
  7. // @license University of Sugma
  8. // @match https://www.heroeswm.ru/war*
  9. // @match https://my.lordswm.com/war*
  10. // @match https://www.lordswm.com/war*
  11. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  12. // @grant unsafeWindow
  13. // ==/UserScript==
  14. const mobileInterval = setInterval(() => {
  15. if ([typeof android, typeof iOS].includes("undefined")) return;
  16. clearInterval(mobileInterval);
  17. if (!android && !iOS) return;
  18. let i = 0;
  19. const buttonsLoadedInterval = setInterval(()=>{
  20. i++;
  21. ["back_to_game", "back_to_home"].forEach(selector=>{
  22. const el = document.querySelector("#"+selector);
  23. if (!el) return;
  24. el.style.display = "none";
  25. if (i > 100) clearInterval(buttonsLoadedInterval);
  26. })
  27. }, 100);
  28. }, 100);
  29.  
  30.