*.fandom.com annoyances remover

19/04/2023, 21:12:07

  1. // ==UserScript==
  2. // @name *.fandom.com annoyances remover
  3. // @namespace Violentmonkey Scripts
  4. // @match https://*.fandom.com/*
  5. // @grant none
  6. // @version 1.0
  7. // @author Starbeamrainbowlabs
  8. // @license Apache2
  9. // @require https://cdn.jsdelivr.net/npm/@violentmonkey/dom@2
  10. // @description 19/04/2023, 21:12:07
  11. // ==/UserScript==
  12.  
  13. function find_and_hide(selector) {
  14. const els = document.querySelectorAll(selector);
  15. let i = 0;
  16. for(const el of els) {
  17. el.style.display = "none";
  18. i++;
  19. }
  20. return i;
  21. }
  22. const removals = { // Items are marked as true once we have hit it
  23. ".marketing-notifications": false,
  24. "#WikiaBar": false
  25. }
  26.  
  27. VM.observe(document.body, () => {
  28. for(const selector in removals) {
  29. if(find_and_hide(selector) > 0) removals[selector] = true;
  30. }
  31.  
  32. if(typeof Object.values(removals).find(val => val === false) == "undefined") return true;
  33. });
  34.  
  35.  
  36. const style = document.createElement("style");
  37. style.textContent = `
  38. .global-navigation {
  39. filter: saturate(0);
  40. opacity: 0.1;
  41. width: 0.5em;
  42. overflow-y: hidden;
  43. transition: filter 0.25s, opacity 0.25s, width 0.25s;
  44. }
  45. .global-navigation:hover {
  46. filter: saturate(60%);
  47. opacity: 1;
  48. width: 66px; /* The default :-/ */
  49. }
  50.  
  51. `;
  52. document.head.appendChild(style);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址