Webseiten-Werkzeuge


heise.de

Apfelfilter

// ==UserScript==
// @name         Heise Apfelfilter
// @description  Filters all Apple related news from the Heise Newsportal
// @namespace    www.heise-ohne-äpfel.de
// @include      http://www.heise.de/*
// @grant        none
// ==/UserScript==
var anchors = document.getElementsByTagName("a");
var keywords = new Array("Apple", "iPad", "iPhone", "iPod", "iTunes", "iOS", "Apples", "iCloud", "iWatch");
for ( var i = 0; i < anchors.length; i++) {
	var title = anchors[i].getAttribute("title");
	if (title != null) {
		for (var index in keywords) {
			var keyword = keywords[index];
			if (title.indexOf(keyword) >= 0) {
				if (anchors[i].parentNode.nodeName.toLowerCase() == "h3") {
					anchors[i].parentNode.parentNode.parentNode.style.display = "none";
				} else {
					anchors[i].parentNode.style.display = "none";
				}
			}
		}
	}
}
artikel/userscripts.txt · Zuletzt geändert: 2014/09/20 00:00 von yvesf