(new Soapbox())->shout(array_map('strtoupper', $opinions)); //Shaun's blog


Me, elsewhere

GitHub
parseword
Miscellaneous public code

Twitter
@parseword
I don't tweet much

XMPP chat
xmpp@shaunc.com
(Pidgin, Miranda, Swift, etc.)


Perfect is the enemy of good enough.

A Stylish recipe to block Reddit ads

Posted November 16, 2017 by shaun

Reddit has been tweaking their site layout, and they've added a big yellow block at the top of the page for logged-out visitors. In addition, even after opting out of the garish new redesign, a bright red "try the redesign" banner appears in the upper left corner of the page.

While I was in the Stylish is now spyware Stylus editor adding some new rules, I figured I'd post my ad-blocking recipe here. This should suppress much of the advertising and promoted content on Reddit's classic web interface, as well as hiding the yellow signup promo, the "Get New Reddit" button, the "test our new profile experience" banner, the "Reddit Premium" sidebar ad, and the giant "Night Mode" and "Infinite Scroll" promo banners.

@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("reddit.com") {
    div#siteTable_organic {
        display: none !important;
    }
    span#sponsored-indicator {
        display: none;
    }
    div#sponsorship {
        display: none;
    }
    div#sponsorshipbox {
        display: none;
    }
    iframe#ad_main {
        display: none;
    }
    iframe#ad_sponsorship {
        display: none;
    }
    div.ad-container {
        display: none !important;
    }
    div.native-ad-container {
        display: none !important;
    }
    div.native-sidebar-ad {
        display: none !important;
    }
    /* Yellow "Welcome to Reddit" banner */
    section.infobar.listingsignupbar {
        display: none;
    }
    /* "Get New Reddit" button */
    div.redesign-beta-optin {
        display: none !important;
    }
    a.redesign-beta-optin {
        display: none !important;
    }
    button.redesign-beta-optin {
        display: none !important;
    }
    /* "Test our new profile experience" banner */
    section.profilebetabar {
        display: none !important;
    }
    /* "Reddit Premium" banner */
    form.premium-banner {
        display: none !important;
    }
    /* Giant "Night Mode" promo */
    section.redesignNightmodeBar {
        display: none !important;
    }
    /* Giant "Infinite Scroll" promo */
    section.redesignInfiniteScroll {
        display: none !important;
    }
}


Recent articles

📰 jisusaiche: Java's installer telemetry

📰 BIND client log error "query_find: query_getdb failed"

📰 Resolving "The lang/perl5.24 port has been deleted: Has expired" portmaster error

📰 Armagaddon2 interim fix for Firefox 56 and other old versions

📰 Strange DNS queries: qname "miep", qtype ANY

📰 Undeliverable as addressed: A massive broken spam campaign?

📰 Using WITH_META_MODE and ccache for FreeBSD build boosts

📰 Resolving subversion error E000013: Unable to create pristine install stream

📰 Enhancements to SmokePing's AnotherDNS probe

📰 Generating vanity DNSSEC key tags

📰 DDoS involving forged packets from 23.225.141.70

📰 Website integrity monitoring through version control

📰 SpamAssassin 3.4.2 fixes security problems, adds HashBL and phishing plugins

📰 Bug or turf war? ICQ via Pidgin now fails with "startOSCARSession: Request Timeout"

📰 🎂

▲ Back to top | Permalink to this page