Skip to content

Instantly share code, notes, and snippets.

@romuald
Forked from anonymous/nofundraiser.js
Last active December 25, 2021 15:18
Show Gist options
  • Save romuald/f1678c197a9e71fb187c to your computer and use it in GitHub Desktop.
Save romuald/f1678c197a9e71fb187c to your computer and use it in GitHub Desktop.
Greasemonkey script to hide the "small" 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);
@arshad115
Copy link

Doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment