Skip to content

Instantly share code, notes, and snippets.

@zbowling
Created January 18, 2012 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zbowling/1631355 to your computer and use it in GitHub Desktop.
Save zbowling/1631355 to your computer and use it in GitHub Desktop.
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
Copy link

qpleple commented Jan 18, 2012

Or hit escape key before the page is fully loaded.

@FWeinb
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