Last active
October 25, 2016 14:45
-
-
Save corrupt/e3bb009d50198df1b51b0ed3decb94c9 to your computer and use it in GitHub Desktop.
Grease-/Tampermonkey script to undo all adblock detection on golem.de. It's a very crude approach using a timer but it has worked reliably for me so far.
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== | |
// @name Golem Unpur | |
// @namespace Golem | |
// @match http://www.golem.de/* | |
// @version 1.0 | |
// @grant none | |
// ==/UserScript== | |
function cleanup() { | |
setTimeout(function () { | |
var artcls = document.getElementsByTagName('article'); | |
for (i = 0; i < artcls.length; i++) { | |
artcls[i].setAttribute('style', 'filter: none !important; pointer-events: auto !important;'); | |
} | |
var elem = null; | |
elem = document.getElementById('gts-clip'); | |
if (elem !== null) { | |
elem.remove(); | |
} | |
elem = document.getElementById('job-market'); | |
if (elem !== null) { | |
elem.remove(); | |
} | |
elem = document.getElementById('pricehits'); | |
if (elem !== null) { | |
elem.remove(); | |
} | |
divs = document.getElementsByTagName('div'); | |
for (i = 0; i < divs.length; i++) { | |
var div = divs[i]; | |
if (div.style.minHeight == '282px') { | |
div.setAttribute('style', 'min-height: 0px!important;'); | |
} else if (div.style.minHeight == '266px') { | |
div.setAttribute('style', 'min-height: 0px!important;'); | |
} | |
} | |
for (var r = document.evaluate('//*[text()="ADBLOCKER ERKANNT"]', document, null, 4, null), n; n = r.iterateNext(); ) { | |
n.parentNode.remove(); | |
} | |
for (var r = document.evaluate('//*[text()="Anzeige"]', document, null, 4, null), n; n = r.iterateNext(); ) { | |
n.parentNode.remove(); | |
} | |
}, 900); | |
} | |
window.addEventListener('load', cleanup, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment