Skip to content

Instantly share code, notes, and snippets.

@mohamedmansour
Created January 18, 2012 08:52
Show Gist options
  • Save mohamedmansour/1632050 to your computer and use it in GitHub Desktop.
Save mohamedmansour/1632050 to your computer and use it in GitHub Desktop.
javascript:(function(){
var overlay = document.getElementById('mw-sopaOverlay');
overlay.parentNode.removeChild(overlay);
var pages = ['mw-page-base', 'mw-head-base', 'content', 'mw-head', 'mw-panel', 'footer'];
var i = 0;
for (i = 0; i < pages.length; i++) {
var pageName = pages[i];
var page = document.getElementById(pageName);
page.setAttribute('style', '');
page.style.display = 'block';
}
})();
@wendelyleal
Copy link

Or you can just use the page's jQuery:

javascript:(function(){$('#mw-page-base,#mw-head-base,#content,#mw-head,#mw-panel,#footer').show();$('#mw-sopaOverlay').hide();})()

My bookmarklet is here: http://wendelyleal.com/labs/sopa/

@clouder
Copy link

clouder commented Jan 18, 2012

nice one wendel, I face palmed after seeing jquery was available and after learning just disabling js does the job as well. here's what I came up with before that happened though

var elms = document.getElementsByTagName('div');for(elm in elms){if(elms[elm].style){elms[elm].style.display='inherit'}};document.getElementById('mw-sopaOverlay').style.display='none';

made it to be entered into browser console, didn't even occur to me to make a bookmarklet

@wendelyleal
Copy link

I came up with a even smaller (and uglier) solution, but the laziness prevented me to update de bookmarklet :P

javascript:(function(){$('[id*=sopaO]').hide();$(/^[^{]*/.exec($('[id*=sopa-b]').html())[0]).show()})()

Then all these JS methods aren't as good as hitting esc before the overlay is loaded -.-

@mohamedmansour
Copy link
Author

@wendelyleal I should have looked if they had jQuery installed, I just developed it when it was midnight :) good job guys!

@mlepage
Copy link

mlepage commented Jan 19, 2012

Um, you know if you read the link Wikipedia gave to learn more about their whole SOPA blackout, it told you right there you could just disable Javascript to view the pages? Like they said, they're not trying to prevent you from using Wikipedia, they just want to ensure they have your attention on this important issue.

@mohamedmansour
Copy link
Author

The whole point of me creating this @mlepage is to show people that "Censorship" cannot happen. I know you could disable JAvaScript or even press escape, but the point is to show that there will be people that will always find ways to go against what is censored. We hate censorship, and this is just there to prove it.

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