Last active
August 29, 2015 14:21
-
-
Save canweriotnow/35dfabb8552e68f406f9 to your computer and use it in GitHub Desktop.
Sun Paywall Defeater
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Alternately, a bookmarklet using the Sun's jQuery dependency against it: | |
// If you don't know what to do with this, create a new bookmark in your browser | |
// and paste this line as teh "address." | |
javascript:$("#reg-overlay").remove();$("html,body").css("overflow","visible"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Userscript for Tampermonkey or Greasemonkey to skip the paywall on the | |
* Baltimore Sun website | |
*/ | |
// ==UserScript== | |
// @name Sun Paywall Defeater | |
// @namespace http://decomplecting.org | |
// @version 0.2 | |
// @description Get rid of the paywall on The Baltimore Sun's website | |
// @author Jason Lewis | |
// @match *://*.baltimoresun.com/* | |
// @grant none | |
// ==/UserScript== | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
if (mutation.addedNodes) { | |
Array.prototype.forEach.call(mutation.addedNodes, function(node) { | |
if (node.id == "reg-overlay") { | |
node.parentNode.removeChild(node); // Fix for when body is not the parent node | |
document.body.style.overflow = "visible"; | |
document.body.parentNode.style.overflow = "visible"; | |
} | |
}); | |
} | |
}); | |
}); | |
observer.observe(document.body, { | |
childList: true, | |
subtree: true, | |
attributes: true, | |
characterData: false | |
}); | |
Also DISCLAIMER NOTICE: something something this is an academic exercise and should never be used by anyone I would certainly never use it because DMCA something something something about the dark side.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issues at the moment: scrolling through additional stories is a little buggy, as something in the UX code relies on detecting the offsetHeight (I'm pretty sure for article count to throw up another paywall... it would explain both errrors here: