NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name SoundCloud - Hide promoted tracks
// @namespace http://www.nickw.co.uk/
// @version 0.2
// @description Hides promoted tracks on the SoundCloud stream page.
// @author Nick Wright
// @match https://soundcloud.com/stream
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
(function()
{
var documentDOMInserted = function(ev)
{
if(ev.target && ev.target.className && ev.target.className.indexOf("lazyLoadingList__list") > -1)
{
document.removeEventListener("DOMNodeInserted", documentDOMInserted);
var list = ev.target;
var listDOMInserted = function(ev)
{
var item = ev.target;
if($(item).find("span.sc-promoted-icon").length > 0)
{
var parent = $(item).closest("li.soundList__item");
if(parent)
{
parent.hide(500);
if(window.console && window.console.info) window.console.info("SoundCloud: Hidden promoted track.");
list.removeEventListener("DOMNodeInserted", listDOMInserted);
}
}
};
list.addEventListener("DOMNodeInserted", listDOMInserted);
}
};
document.addEventListener("DOMNodeInserted", documentDOMInserted);
})();