Skip to content

Instantly share code, notes, and snippets.

Created November 1, 2015 14:08
Show Gist options
  • Save anonymous/f4bf75f2de4dd7ea9e1d to your computer and use it in GitHub Desktop.
Save anonymous/f4bf75f2de4dd7ea9e1d to your computer and use it in GitHub Desktop.
Greasemonkey script to hide the Wikipedia fundraiser banner
// ==UserScript==
// @name No Wikipedia fundraiser
// @namespace http://chivil.com/
// @version 0.1
// @description Should hide Wikipedia "small" banner on each page
// @author Romuald Brunet
// @match https://*.wikipedia.org/*
// @grant none
// @run-at document-end
// ==/UserScript==
function checkBanner() {
if ( window.mw && mw.centralNotice && mw.centralNotice.bannerData ) {
mw.centralNotice.bannerData.hideResult = true;
/*
if ( window.fundraisingBanner ) {
fundraisingBanner.hide();
}
*/
} else if ( (new Date()).getTime() < giveup ) {
window.setTimeout(checkBanner, 10);
}
}
// Stop polling after 4 seconds
var giveup = (new Date()).getTime() + 4000;
window.setTimeout(checkBanner, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment