Last active
January 18, 2024 10:59
-
-
Save ffflorian/9807bc4e037ead2f7a8defc2b86d99eb to your computer and use it in GitHub Desktop.
Spiegel Online Paywall
This file contains hidden or 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
/** | |
* Read Spiegel Online Plus Articles, hidden behind a rot(1) "encryption" | |
* and a blur filter. | |
* Just copy this and paste it into your browser's console (press F12) - | |
* or use the minified version, see comments below. | |
* Try it out on any article at http://www.spiegel.de/spiegelplus/. | |
* | |
* @ffflorian, 2016 | |
*/ | |
(function (d) { | |
var getClass = d.getElementsByClassName.bind(d); | |
var each = Array.prototype.forEach; | |
var important = '!important;'; | |
var inherit = 'inherit' + important; | |
var filter = 'filter:none' + important; | |
var select = 'user-select:' + inherit; | |
var obfuscated = 'obfuscated'; | |
var obfuscatedContentElement = getClass(obfuscated + '-content')[0].parentNode; | |
if (obfuscatedContentElement) { | |
each.call([ | |
getClass('js-spiegelplus-'+ obfuscated + '-intro')[0], | |
obfuscatedContentElement.nextElementSibling, | |
d.getElementById('laterpay-replacement'), | |
getClass('laterpay-under-overlay')[0] | |
], obj => { | |
obj.parentNode.removeChild(obj); | |
}); | |
obfuscatedContentElement.setAttribute('style', | |
filter + | |
'-ms-' + filter + | |
'-webkit-' + filter + | |
select + | |
'-webkit-' + select + | |
'-ms-' + select + | |
'-moz-' + select + | |
'opacity:1' + important + | |
'pointer-events:' + inherit | |
); | |
each.call(getClass(obfuscated), obj => { | |
obj.innerHTML = obj.innerHTML.replace(/(?!<*>)[^ ](?![^<]*>)/g, char => { | |
char = char.charCodeAt(0); | |
switch(char) { | |
case 32: return ' '; | |
case 177: return '&'; | |
case 178: return '!'; | |
case 180: return ';'; | |
case 181: return '='; | |
default: return String.fromCharCode(char - 1); | |
} | |
}); | |
}); | |
} | |
}(document)); |
Unfortunately, this doesn't work anymore.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minified: