// ==UserScript== // @name amazon-sponsored-links // @namespace chillihead // @description Remove sponsored links from Amazons search results // @include http://www.amazon.co.uk* // ==/UserScript== if(document.getElementsByTagName("span")!=null) { var s = document.getElementsByTagName("span"); for(var i = 0; i < s.length; i++) { if(s[i].getAttribute("class") != null) { var cls = s[i].getAttribute("class"); if(cls == "h1") { if(s[i].innerHTML != null) { var txt = s[i].innerHTML; if(txt == "Sponsored Links:") { // great-grandparent of this span is the containing table. var theTable = s[i].parentNode.parentNode.parentNode; // get the tables parent var tableParent = theTable.parentNode; // remove the table of sponsored links. tableParent.removeChild(theTable); } } } } } }
You need to create an account or log in to post comments to this site.