Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Un-blackout Wikipedia methods

#Un-blackout Wikipedia methods.

I'm totally with Wikipedia and support them blacking out the site. These methods work for the technical people out there that still/want access. I hope you use these methods only after contacting congress to help fight SOPA and PIPA.

##AdBlock and NoScript method

Add this option to your AdBlock or NoScript settings. In Google Chrome, you can add a javascript exception in your preferences for this URL as well.

|http://meta.wikimedia.org/w/index.php?title=Special:BannerLoader&banner=blackout&campaign=English+Wikipedia+Blackout*

##Bookmarklet method

Borrowed from HackerNews comment:

javascript:%24(%22%23mw-page-base%2C%20%23mw-head-base%2C%20%23content%2C%20%23mw-head%2C%20%23mw-panel%2C%20%23footer%22).css(%22display%22%2C%22inherit%22)%3B%24(%22%23mw-sopaOverlay%22).css(%22display%22%2C%22none%22)

Another one:

javascript:(function(){document.getElementById("mw-page-base").style.display="block"; document.getElementById("mw-head-base").style.display="block"; document.getElementById("content").style.display="block"; document.getElementById("mw-head").style.display="block"; document.getElementById("mw-panel").style.display="block"; document.getElementById("footer").style.display="block"; document.getElementById("mw-sopaOverlay").style.display="none";})()

##Javascript soup

Various other javascript snippets that all work since JQuery is already loaded into the page.

Method 1 (JQuery brute force):

$('*:hidden').show();$('#mw-sopaOverlay').hide();

Method 2 (JQuery and more specific):

$('#mw-page-base, #mw-head-base, #content, #mw-head, #mw-panel, #footer').show();$('#mw-sopaOverlay').hide()

Method 3 (JQuery and very verbose):

$("#mw-page-base, #mw-head-base, #content, #mw-head, #mw-panel, #footer").css("display", "inherit");
$("#mw-sopaOverlay").css("display", "none");

Method 4 (shortest vanilla JS implementation):

d=document;f='getElementById';d[f]('mw-sopaOverlay').innerHTML='';d[f]('content').style.display='block'

Other

  1. Disable javascript in your browser.
  2. Use the mobile site.
@qpleple

This comment has been minimized.

Copy link

qpleple commented Jan 18, 2012

Or hit escape key before the page is fully loaded.

@FWeinb

This comment has been minimized.

Copy link

FWeinb commented Jan 18, 2012

My shortest jQuery with 'valid' result:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.