Skip to content

Instantly share code, notes, and snippets.

@sevi418
Last active April 7, 2025 10:21
Show Gist options
  • Save sevi418/04755255c970ba30a7f65f85a449fca2 to your computer and use it in GitHub Desktop.
Save sevi418/04755255c970ba30a7f65f85a449fca2 to your computer and use it in GitHub Desktop.
UBlock Origin Rules to Block CSDN Domains in DuckDuckGo and Google search results.
! Block CSDN domains in DuckDuckGo search results
duckduckgo.com##article[data-nrn~="result"]:has(a[href*="csdn.net"])
duckduckgo.com##article[data-nrn~="result"]:has(a[href*="csdn.com"])
duckduckgo.com##article[data-nrn~="result"]:has(a[href*="csdnimg.cn"])
duckduckgo.com##article[data-nrn~="result"]:has(a[href*="gitcode.com"])
duckduckgo.com##article[data-nrn~="result"]:has(a[href*="gitcode.net"])
duckduckgo.com##article[data-nrn~="result"]:has(a[href*="gitcode.host"])
! Block CSDN domains in Google search results
google.*##div[class='MjjYud']:has(a[href*="csdn.net"])
google.*##div[class='MjjYud']:has(a[href*="csdn.com"])
google.*##div[class='MjjYud']:has(a[href*="csdnimg.cn"])
google.*##div[class='MjjYud']:has(a[href*="gitcode.com"])
google.*##div[class='MjjYud']:has(a[href*="gitcode.net"])
google.*##div[class='MjjYud']:has(a[href*="gitcode.host"])
! Network filters to block the domains entirely
*://*.csdn.net/*$important
*://*.csdn.com/*$important
*://*.csdnimg.cn/*$important
*://*.gitcode.com/*$important
*://*.gitcode.net/*$important
*://*.gitcode.host/*$important
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment