Skip to content

Instantly share code, notes, and snippets.

@bossanova808
Created February 17, 2019 04:40
Show Gist options
  • Save bossanova808/515dddeb8e7f459457b5a94479ded876 to your computer and use it in GitHub Desktop.
Save bossanova808/515dddeb8e7f459457b5a94479ded876 to your computer and use it in GitHub Desktop.
Userscript to Remove The Australian paywall.
// ==UserScript==
// @name Remove The Australian Paywall
// @version 1
// @grant none
// @match *://www.theaustralian.com.au/*
// ==/UserScript==
window.addEventListener('load', function() {
console.log("Removing the Australian paywall overlay...");
// Remove the paywall class from the <html> element itself
var elem = document.documentElement;
elem.classList.remove("lightcase-open");
//Get rid of all the blocking elements/messages
var elem1 = document.getElementsByClassName("subscribe-popover");
//HTMLCollection...
while(elem1.length > 0) {
elem1[0].remove();
}
var elem2 = document.getElementById("lightcase-overlay").remove();
var elem3 = document.getElementById("lightcase-loading").remove();
var elem4 = document.getElementById("lightcase-case").remove();
var elem5 = document.getElementById("lightcase-nav").remove();
}, false);
@bossanova808
Copy link
Author

bossanova808 commented Feb 17, 2019

Or event simpler - and no flash! - just use the top bit, i.e.

window.addEventListener('load', function() {
  console.log("Removing the Australian paywall overlay...");
  // Remove the paywall class from the <html> element itself
  var elem = document.documentElement;
  elem.classList.remove("lightcase-open");
}

and use Stylish to block the rest...

#lightcase-overlay{
    display: none !important;
}
#lightcase-loading{
    display: none !important;
}
#lightcase-case{
    display: none !important;
}
#lightcase-nav{
    display: none !important;
}
.subscribe-popover{
    display: none !important;
}

@iamadamdev
Copy link

How are you using this exactly?

(I tried adding the JS part in contentScript.js and added the appropriate permissions in manfiest.json, it helped a little, it hid the small popup that appears after a second, but I still get the entire paywall block on some articles sometimes. I can't just dump CSS in contentScript.js)

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