Last active
January 27, 2018 16:33
-
-
Save dan-lee/9cfaeb0079eb0f41c6ed83ef36015a56 to your computer and use it in GitHub Desktop.
Deobfuscate and hide paywall for SPIEGEL PLUS
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
let getReplacement = char => | |
/[\s\n]/.test(char) ? char : String.fromCharCode(char.charCodeAt(0) - 1); | |
let deobfuscate = text => | |
text | |
.trim() | |
.split('') | |
.reduce((prev, curr) => prev + getReplacement(curr), ''); | |
Array.from(document.querySelectorAll('.obfuscated')).forEach(x => x.innerText = deobfuscate(x.innerText)); | |
let blurred = document.querySelector('.obfuscated-content'); | |
let parent = blurred.parentNode; | |
blurred.style.cssText = parent.style.cssText = 'filter: none !important;opacity: 1 !important;user-select: all !important;pointer-events: all !important;'; | |
parent.nextSibling.style.display = 'none'; | |
document.querySelector('.js-spiegelplus-obfuscated-intro').remove(); | |
/* | |
Generated bookmarklet: | |
javascript:(function()%7Blet getReplacement %3D char %3D>%2F%5B%5Cs%5Cn%5D%2F.test(char) %3F char %3A String.fromCharCode(char.charCodeAt(0) - 1)%3Blet deobfuscate %3D text %3D>text.trim().split('').reduce((prev%2C curr) %3D> prev %2B getReplacement(curr)%2C '')%3BArray.from(document.querySelectorAll('.obfuscated')).forEach(x %3D> x.innerText %3D deobfuscate(x.innerText))%3Blet blurred %3D document.querySelector('.obfuscated-content')%3Blet parent %3D blurred.parentNode%3Bblurred.style.cssText %3D parent.style.cssText %3D 'filter%3A none !important%3Bopacity%3A 1 !important%3Buser-select%3A all !important%3Bpointer-events%3A all !important%3B'%3Bparent.nextSibling.style.display %3D 'none'%3Bdocument.querySelector('.js-spiegelplus-obfuscated-intro').remove()%7D)() | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment