Hide Wikipedia fundraiser banner

You should support Wikipedia through the Wikimedia Foundation. However if you already have and you want to use wiki on another machine or browser, you can get rid of the banner by running this.

// create a date object
var d = new Date();
// save the current date
var now = Math.round(d.getTime() / 1000);
// add 2 years for good measures
d.setFullYear(d.getFullYear() + 2);
// set the cookie
$.cookie("centralnotice_hide_fundraising", '{"v":1,"created":' + now + ',"reason":"donate"}', {"expires": d});

Or in one (ugly) line:

$.cookie("centralnotice_hide_fundraising", '{"v":1,"created":' + Math.round(new Date().getTime() / 1000) + ',"reason":"donate"}', {"expires": new Date(new Date().getTime() + 2 * 365 * 24 * 60 * 60 * 1000).toGMTString()});

Leave a Reply

Your email address will not be published. Required fields are marked *