Skip to content

Instantly share code, notes, and snippets.

@icedterminal
Last active September 22, 2023 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icedterminal/a2d6c2a808c481fd587f68e78f9581d3 to your computer and use it in GitHub Desktop.
Save icedterminal/a2d6c2a808c481fd587f68e78f9581d3 to your computer and use it in GitHub Desktop.
Filters for uBlock Origin extension.

uBlock Origin Filters

Browser
Firefox
Chromium

View the extension settings and click the "My Filters" tab.

Manifest v3 hampers this extensions ability to work as intended in most Chromium browsers. Firefox should be your choice if you value the power the of this extension. If you want to use a Chromium based browser, consider Vivaldi or Brave.

Note: Where ! Fonts are defined in style(), you do not have to copy these filters.

Public sites

Universal

! UNIVERSAL
! Blocks the "Sign in/up with Google" modal that appears on so many sites.
||accounts.google.com/gsi/iframe^

accuweather.com

! ACCUWEATHER
! Aligns content and hides the useless "news articles"
accuweather.com##.page-column-1:style(margin: 0 !important; width: 100% !important;)
accuweather.com##.page-column-2

bestbuy.com

! BEST BUY
! Hides the little circle "assistant" bottom right
www.bestbuy.com##.shop-blue-assist

corsair.com

! CORSAIR
! Removes the large header
corsair.com##.text-white.block.lg\:flex

github.com

! GITHUB
! Fonts
gist.github.com##code, pre, .file-info, .blob-num, .blob-code-inner, .input-monospace:style(font-family:'Cascadia Code', mono !important;)
github.com##body:style(font-family:'SF Pro Display' !important;)
github.com##code, pre, .text-mono, .input-monospace, .blob-code-inner:style(font-family:'Cascadia Code', mono !important;)
! Fix disabling highlighting of repo name when you want to copy and paste to delete
github.com##.FormControl-label:style(user-select:auto !important;)

newegg.com

! NEWEGG
! Hides Neweggs own Google sign in prompt
newegg.com###GoogleSignPrompt
newegg.com##.masker.opacity-30
! Removes sponsored items at the top
newegg.com##div.menu-box
newegg.com##a.item-container:upward(.items-grid-view)
! Removes sponsored row sidebar and expands the row body full width 
newegg.com##.has-side-banner>.row-side
newegg.com##.row.has-side-banner>.row-body:style(margin-right:0 !important;)

raider.io

! RAIDER.IO
! Blocks an image asking you to not block ads.
||cdnassets.raider.io/images/site/verts/zoneblock_bg_landscape.jpg$image
! Cleans up the rest of the site by hiding elements like streams, feeds, ad place holders, etc.
raider.io##.fresnel-greaterThanOrEqual-xl.rio-right-pane.slds-shrink-none.slds-grow-none.slds-col, .slds-p-around--x-small.rio-hidden--small.slds-text-align--center, .slds-text-align--center.slds-m-top--small, .slds-align--absolute-center.slds-p-around--medium.rio-hidden--small
raider.io##div.slds-col > div.fresnel-greaterThan-sm.fresnel-container:remove()
raider.io###twitter-embed
! These are CSS rules I used for a different extension. Leaving these here for my own reference.
!.slds-text-align--center.rio-hidden--small.slds-p-around--x-small {display:none;}
!.rio-right-pane {display:none !important;}
!.slds-medium-nowrap.slds-wrap.slds-grid.slds-text-align--center.slds-p-around--small.rio-panel--patreon {display:none;}
!.sticky-inner-wrapper > .slds-text-align--center {display:none;}
!.rio-hidden--small.slds-p-around--medium.slds-align--absolute-center {display:none !important;}

reddit.com

⚠️ These rules specifically target mobile browsing. This is only possible on Android using Firefox! This is not possible on Android using Chromium (Chrome) because Google claims extensions on Android would create a security problem. While this has some merit, Google knows a significant portion of their traffic is mobile. Allowing extensions would allow ad blocking. iOS has several restrictions and limitations that make it impossible. Notably the iOS Developer Guidelines 2.5.6. Applying these filters on desktop may adversely affect your normal use. I have not tested them on desktop and do not intend to. They were created with the use of Firefox debug tools (about:debugging) on a real Android device.

! REDDIT MOBILE
! Hides all the pop-ups and the bottom bar encouraging users to use the shit app.
! Note that dismissing the initial bottom bar prompt will remove the class that intentionally disables scrolling.
! Since we are hiding it, the scrolling will remain disabled. Buncha' dicks.
reddit.com##.XPromoPopupRpl.m-active
reddit.com##.XPromoBottomBar.m-consolidate
reddit.com###bottom-sheet
! Remove the css class that intentionally disables scrolling.
reddit.com##body:remove-class(scroll-disabled)
! For posts and subs only.
! Body inline style that intentionally disables scrolling.
reddit.com##body:style(overflow:auto !important;pointer-events:auto !important;)
! Hides the bottom bar.
reddit.com##.bottom-bar
! Hides more posts you may be interested in
reddit.com##.right-sidebar
! Deletes the accept prompt tester.
reddit.com###acceptabletest:remove()
! Deletes the adblock tester.
reddit.com###adblocktest:remove()
! Deletes the blocking modal for NSFW subs. You still need to sign into reddit in Firefox to see the posts.
!reddit.com###modal-dialog
reddit.com##div.sidebar-grid:style(filter:none !important;)
reddit.com##xpromo-nsfw-blocking-modal:remove()

These rules target mobile or desktop.

! REDDIT
! Hide automod stickied comments
reddit.com##[data-testid="comment_author_link"][href="/user/AutoModerator/"]:upward(.Comment)

twitch.tv

! TWITCH
! Removes the front page carousel so you don't have to deal with auto play content.
twitch.tv##main>div>div.simplebar-scroll-content>div>div>div>div.front-page-carousel:remove()

weather.com

If you have a PiHole or AdGuard home instance running, you need to whitelist mparticle.weather.com. Please note this is a tracking service! Sadly, weather.com has integrated it into the core function. With it blocked, you cannot see search or see weather.

! WEATHER.COM
! Hides a myriad of useless crap.
! NOTE: This makes the root (/) empty because it's all filler "news articles"
weather.com##[id^=WxuContentMedia-], [id^=Taboola-sidebar-], [id^=WxuSmartMessage-sidebar-]
! The search box is disabled when hiding certain elements. This fixes that.
weather.com##+js(remove-attr.js, disabled, #LocationSearch_input)

wowhead.com

! WOWHEAD
! Cleans up wowhead by removing the sidebar and promo content.
wowhead.com##.sidebar-wrapper, .sidebar, .blocks, .element-highlight-dialog, .element-highlight-highlighter, .news-recent-content, .zaf-unit-wrapper, .premium-promo-row, #video-pos-page
! Fonts.
wowhead.com##body, h1, h2, h3, h4, h5, h6, .imitation-heading, .header-nav>a, .header-nav-features>a, .data-trees>a, #data-tree-switcher>div>a, .header-user>a:style(font-family:'SF Pro Display','Helvetica Now Display Regular','Helvetica Neue',Helvetica,Roboto,SegoeUI,sans-serif !important;)
! Aligns some content so the page is cleaner.
wowhead.com###page-content:style(margin:0 !important;padding:0 !important;)
wowhead.com##.news-recent[data-has-video-unit="true"]:style(grid-template-columns: 1fr 1fr !important;)
! This fixes text flickering in Chromium browsers
wowhead.com##.comment, .comment-content-column:style(-webkit-transform-style: preserve-3d !important;)

youtube.com

! YOUTUBE
! Hides YouTube TV promo shelf
youtube.com##ytd-rich-section-renderer.ytd-rich-grid-renderer.style-scope
! Hides promot content similar to Google doodles
youtube.com###big-yoodle.ytd-rich-grid-renderer
! Remove "Adblockers are not allowed" warning/pop-up
youtube.com##+js(set, yt.config_.openPopupConfig.supportedPopups.adBlockMessageViewModel, false)
youtube.com##+js(set, Object.prototype.adBlocksFound, 0)
youtube.com##+js(set, ytplayer.config.args.raw_player_response.adPlacements, [])
youtube.com##+js(set, Object.prototype.hasAllowedInstreamAd, true)
! Four (4) Videos Grid tweaks
! Skeleton before videos load
youtube.com###home-page-skeleton .rich-grid-media-skeleton:style(max-width: 100% !important; margin: 0 4px 0 4px !important)
! After vidoes load
youtube.com###contents > ytd-rich-grid-row, #contents > ytd-rich-grid-row > #contents, [page-subtype="home"] #content.ytd-rich-section-renderer, [page-subtype="home"] ytd-rich-section-renderer, [page-subtype="sports"] #content.ytd-rich-section-renderer, [page-subtype="sports"] ytd-rich-section-renderer:style(display: contents !important)
youtube.com##ytd-rich-grid-media:style(max-width: 100% !important; margin: 0 4px 0 4px !important)
! Calcluations of margin and width
youtube.com##ytd-rich-item-renderer[is-slim-grid]:last-of-type:style(margin-right: calc(var(--ytd-rich-grid-item-margin)/2) !important)
youtube.com##ytd-rich-item-renderer[is-slim-grid]:first-of-type:style(margin-left: calc(var(--ytd-rich-grid-item-margin)/2) !important)
youtube.com##[page-subtype="home"] #contents.ytd-rich-grid-renderer, [page-subtype="subscriptions"] #contents.ytd-rich-grid-renderer, [page-subtype="hashtag-landing-page"] #contents.ytd-rich-grid-renderer, [page-subtype="sports"] #contents.ytd-rich-grid-renderer:style(width: calc(100% - 3 * 1vw) !important)
youtube.com##[page-subtype="home"] #dismissible.ytd-rich-shelf-renderer, [page-subtype="home"] #dismissed.ytd-rich-shelf-renderer, [page-subtype="sports"] #dismissible.ytd-rich-shelf-renderer:style(width: calc(100% - 0.2 * 1vw) !important)
! Fixed margins
youtube.com##ytd-rich-grid-row:style(--ytd-rich-grid-item-margin: 4px; !important)
youtube.com###contents.ytd-rich-shelf-renderer:has(#video-title.ytd-rich-grid-media):style(--ytd-rich-grid-item-margin: 4px; !important)
youtube.com##ytd-notification-multi-action-renderer[shelf-dismissal]:style(margin-top: 12px !important)
youtube.com##ytd-rich-item-renderer:style(margin-bottom: 32px !important)
youtube.com##[page-subtype="subscriptions"] #content.ytd-rich-section-renderer:style(margin: 0 8px !important)
youtube.com##[page-subtype="home"] #content.ytd-rich-section-renderer > *.ytd-rich-section-renderer, [page-subtype="sports"] #content.ytd-rich-section-renderer > *.ytd-rich-section-renderer:style(order: -1 !important; margin-top: -40px !important)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment