Chrome: Fade out marketplace posts

KocerRoxy

Power Member
Jr. VIP
Joined
Sep 15, 2010
Messages
511
Reaction score
180
If you're like me and don't want to see market posts on the bhw home page, you can use this:

Code:
// ==UserScript==
// @match http://www.blackhatworld.com/
// ==/UserScript==
var _loader = function(w)
{
    var bad = [
        'affiliate-programs-cpa-networks',
        'content-copywriting',
        'domains-websites-sale',
        'hosting',
        'hot-deals',
        'images-logos-videos',
        'misc',
        'proxies-sale',
        'seo-link-building',
        'seo-other',
        'seo-packages',
        'social-media',
        'web-design'
    ];
     var list = document.querySelectorAll("#homepage h4.threadtitle a")


     for ( var i = 0 ; i < list.length ; i++ )
     {
         var href = list[i].href;
         var parts = href.split('/');
         var businessEnd = parts.slice(-2,-1)[0];
         if ( bad.indexOf(businessEnd) != -1 )
         {
             var trContainer = list[i].parentNode.parentNode.parentNode.parentNode;
             trContainer.className = 'grayed';
         }
     }


     sheet = window.document.styleSheets[3];
     sheet.insertRule('tr.grayed * { color: #333 !important; font-weight: normal !important; }', sheet.cssRules.length);


}
var c = document.createElement('script');
c.text = '(' + _loader + ')(window);';
document.head.appendChild(c);

To use this: save it in something like market.user.js on your desktop, go to extensions in chrome and drag it from your desktop to the extensions page, then refresh bhw and it should work
This is the end result: ( The posts are not removed, only grayed out. This only works on the home page, forums / subforums are not affected )
market.jpg
 
Settings -> General Settings -> Forums To Exclude From View

;)

Kudos on the userscript though :)
 
I did not know that :). The advantage with this is that they still appear but you can normally just scan over them.
 
Back
Top