Skip to content

Instantly share code, notes, and snippets.

@Erquint
Last active October 30, 2019 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415 to your computer and use it in GitHub Desktop.
Save Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415 to your computer and use it in GitHub Desktop.
FANDOM/Wikia PseudoMonobook+ Implements https://dev.fandom.com/wiki/PseudoMonobook on FANDOM wiki pages and gets rid of extra annoyances. Install with the following link: https://gist.githubusercontent.com/Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415/raw/FWPMP.user.js
// ==UserScript==
// @name FANDOM/Wikia PseudoMonobook+
// @description Implements https://dev.fandom.com/wiki/PseudoMonobook on FANDOM wiki pages and gets rid of extra annoyances.
// @version 1.8.0
// @namespace gness.na@gmail.com
// @author https://gist.github.com/Erquint
// @homepageURL https://gist.github.com/Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415
// @updateURL https://gist.githubusercontent.com/Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415/raw/FWPMP.user.js
// @downloadURL https://gist.githubusercontent.com/Erquint/ec4f688c7d6d9ea2ccddff8acb3a8415/raw/FWPMP.user.js
// @match http*://*wikia.com/wiki/*
// @match http*://*fandom.com/wiki/*
// @resource PseudoMonobook https://dev.fandom.com/load.php?mode=articles&articles=u:dev:MediaWiki:PseudoMonobook.css&only=styles
// @run-at document-end
// @noframes
// @inject-into page
// @noframes
// @grant GM_addStyle
// @grant GM_getResourceURL
// ==/UserScript==
let searchToggle = document.getElementsByClassName('wds-global-navigation__search-toggle')[0];
let searchInput = document.getElementsByClassName('wds-global-navigation__search-input')[0];
let classicCategories = document.getElementsByClassName('category-layout-selector__item')[0];
function removeId(i){i = document.getElementById(i); i && i.remove()};
function removeClass(i){Array.from(document.getElementsByClassName(i)).forEach(e => e.remove())};
//function removeTag(i){Array.from(document.getElementsByTagName(i)).forEach(e => e.remove())};//Unused
GM_addStyle(`@import '${GM_getResourceURL('PseudoMonobook')}'`);
GM_addStyle('.WikiaMainContent {width: 100% !important;}');
GM_addStyle('.results-wrapper {width: 80% !important;}');
removeId('ad-skin');
removeId('WikiaRailWrapper');
removeId('WikiaFooter');
removeId('WikiaTopAds');
removeClass('wds-global-navigation__logo');
removeClass('wds-global-footer__header');
removeClass('wds-global-footer__bottom-bar');
removeClass('SearchAdsTopWrapper');
searchInput.addEventListener('blur' ,e => searchToggle.click());
searchToggle.click();
searchInput.blur();
classicCategories && classicCategories.click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment