Oli Warner About Contact Oli on Twitter Subscribe

How to unblock Wikipedia

Wednesday, 18 January 2012 javascript ubuntu

I thought I could go without Wikipedia for one day and I was wrong. Less than an hour into the day and I needed to look something up. I could go and look it up somewhere else but I like Wikipedia!

On loading the site, you’ll notice that the content loads and then flashes to be replaced by the anti-SOPA sign. That’s a clear sign that there’s a little nugget of Javascript is running to break things.

Wikipedia are probably doing this so they don’t lose their search ranking for the day but it’s lazy. They should have put in a temporary redirect for every URL. Still, I can’t complain because it does make it pathetically easy to bypass.

You have a few options.

NoScript or Ad Block Plus

You can use these plugins to block Javascript on Wikipedia. Problem gone.

For Adblock, go into the filter rules, and add a custom filter to block http://meta.wikimedia.org/w/index.php?title=Special:BannerLoader&banner=blackout*. This should target just the script that is hiding things and leave the rest of the site working as expected.

NoScript should allow you to disable Javascript in whole on just Wikipedia, which should do the job without you losing any major functionality.

Edit Per the comment from Rich below you can also just block Javascript outright. You’ll find that in your browser’s settings. I wouldn’t recommend this for most people because it will stop Javascript running completely and if you leave things that way, you’ll find a lot of the rest of the Internet stops working as you expect.

A line of code

As a web developer, my natural instinct was to see how they did it and if jQuery was available. After two minutes, I had things fixed. You can reverse the entire thing by pasting the following into your address-bar:

javascript:$('#mw-page-base,#mw-head-base,#content,#mw-head,#mw-panel,#footer,#mw-sopaOverlay').toggle()

Edit Turns out that Firefox now blocks Javascript in the address bar so to run it in Firefox you either have to use a Bookmark (below) or press Control+Shift+K and then paste it in, minus the javascript: from the beginning.

I suggest you save that as a bookmark. You can right click the following link Unblock Wikipedia and save it to your bookmarks. In Firefox, I suggest you add it to the Bookmarks Toolbar. So now when you’re on Wikipedia, just click that bookmark and the site springs back into action.

Edit: Ninja reflexes

Per the comment from Danny Hage, you can just click the stop button at the right point (after the page has loaded but before the SOPA banner loads). Timing is key here. If your internet is too fast, you might struggle.

It’s a bit fiddly with a mouse so you can just hit Escape instead.