Fandom.com --- Cleaner Wikis Userscript

Removes all of the non-wiki parts of fandom.com wikis, reduces the footprint of the search overlay, and forces the search overlay to use wiki-theme colors. Based on "Fandom - Remove Garbage" by jurassicplayer.

  1. // ==UserScript==
  2. // @name Fandom.com --- Cleaner Wikis Userscript
  3. // @description Removes all of the non-wiki parts of fandom.com wikis, reduces the footprint of the search overlay, and forces the search overlay to use wiki-theme colors. Based on "Fandom - Remove Garbage" by jurassicplayer.
  4. // @namespace https://greasyfork.org/users/797186
  5. // @author G3T
  6. // @version 1.0.7
  7. // @license unlicense
  8. // @grant GM_addStyle
  9. // @run-at document-end
  10. // @include http://fandom.com/*
  11. // @include https://fandom.com/*
  12. // @include http://*.fandom.com/*
  13. // @include https://*.fandom.com/*
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. let css = `
  18.  
  19.  
  20. #mixed-content-footer,
  21. .wds-global-footer,
  22. #WikiaBarWrapper,
  23. .wds-global-navigation__content-bar-left,
  24. .global-navigation,
  25. .fandom-sticky-header,
  26. .gpt-ad,
  27. .ad-slot-placeholder.top-leaderboard.is-loading,
  28. .page__right-rail,
  29. .search-modal::before,
  30. form[class^="SearchInput-module_form__"] .wds-icon,
  31. .notifications-placeholder,
  32. .top-ads-container,
  33. .instant-suggestion,
  34. .unified-search__result.marketplace {
  35. display: none;
  36. }
  37.  
  38. .main-container {
  39. width: 100%;
  40. margin-left: 0px;
  41. }
  42.  
  43. .community-header-wrapper {
  44. height: auto;
  45. }
  46.  
  47. .search-modal {
  48. position: absolute;
  49. bottom: auto;
  50. left: auto;
  51. }
  52.  
  53. .search-modal__content {
  54. width: 420px;
  55. top: 20px;
  56. right: -3px;
  57. min-height: auto;
  58. background-color: var(--theme-page-background-color--secondary);
  59. border: 1px solid var(--theme-border-color);
  60. animation: none;
  61. }
  62.  
  63. form[class^="SearchInput-module_form__"] {
  64. border-bottom: 2px solid var(--theme-border-color);
  65. color: var(--theme-border-color);
  66. }
  67.  
  68. form[class^="SearchInput-module_form__"] .wds-button {
  69. --wds-primary-button-background-color: var(--theme-accent-color);
  70. --wds-primary-button-background-color--hover: var(--theme-accent-color--hover);
  71. --wds-primary-button-label-color: var(--theme-accent-label-color);
  72. }
  73.  
  74. input[class^="SearchInput-module_input__"] {
  75. color: var(--theme-page-text-color);
  76. border-left: none;
  77. padding: 0;
  78. }
  79.  
  80. a[class^="SearchResults-module_seeAllResults"] {
  81. color: var(--theme-link-color) !important;
  82. }
  83. `;
  84. if (typeof GM_addStyle !== "undefined") {
  85. GM_addStyle(css);
  86. } else {
  87. let styleNode = document.createElement("style");
  88. styleNode.appendChild(document.createTextNode(css));
  89. (document.querySelector("head") || document.documentElement).appendChild(styleNode);
  90. }
  91. })();