GreaseMonkey script – Keep heise.de ad-free

Use the following script to keep the heise.de newsticker free of ads:


// ==UserScript==
// @name Heise Newsticker
// @description Removes unwanted ads from Heise newsticker
// @include http://www.heise.de/newsticker/*
// ==/UserScript==

(function() {

// on load or realtime?
var onLoad = false;

if (onLoad) {
// on load
window.addEventListener("load", onDocumentLoad, false);
} else {
// realtime
onDocumentLoad();
}

function onDocumentLoad()
{
try
{
var elements = document.getElementsByTagName('div');
for (var i=elements.length-1; i>=0; i--)
{
var el = elements[i];
var attr = el.getAttribute("class");

if (
(attr == "adbottom")
|| (attr == "adbottom_itmarkt")
|| (attr == "contentbanner")
|| (attr == "skyscraper")
|| (attr == "heiseadvert")
|| (attr == "werbung")
|| (attr == "leaderboard")
)
{
el.parentNode.removeChild(el);
}
}
}
catch (e)
{
GM_log("exception!");
}
}

})();

One Response to “GreaseMonkey script – Keep heise.de ad-free”

  1. heise de Says:

    […] von heise.de zu unterdr??cken. Es ist unter http://hd42.de/downloads/heiseadclean.user.jshttp://www.cpuidle.de/blog/?p=5Dipl.-Inf. FH Sebastian Heise – heise-IT – Webdevelopment &amp IT …Bitte keine Emails an folgende […]

Leave a Reply