Skip to content

Instantly share code, notes, and snippets.

@corrupt
Last active October 25, 2016 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corrupt/e3bb009d50198df1b51b0ed3decb94c9 to your computer and use it in GitHub Desktop.
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.
// ==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