Skip to content

Commit

Permalink
no need to filter out procedural filters
Browse files Browse the repository at this point in the history
  • Loading branch information
dharb committed Jan 16, 2025
1 parent 7120764 commit 891b1a7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 29 deletions.
30 changes: 12 additions & 18 deletions rules/filterlist.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[Adblock Plus 2.0]
! Title: CPM Cosmetic Filter List
! Based on EasyList dd3a7c08e4fd5c306a042a52b420eb0162ba2e39
! Based on EasyList f71790e6c5e094a1c7eedfe4fb82a8fa3f8af385

! DO NOT EDIT MANUALLY, your changes will be lost
! Generated on 2025-01-15T14:35:53.864Z
! Generated on 2025-01-16T22:10:37.049Z
!------------------------General element hiding rules-------------------------!
! easylist_cookie_general_hide.txt
###-CookieConsentContainer
Expand Down Expand Up @@ -10216,28 +10216,17 @@
##.cookie-popup-overlay
##.cookie-popup-win
##.cookie-popup-wrapper
##.cookie-popup.variantSelectMobile
##.cookie-popup__heading
##.cookie-popup__wrapper
##.cookie-pp
##.cookie-preference-modal
##.cookie-preference__overlay
##.cookie-privacy
##.cookie-privacy-banner
##.cookie-privacy-container
##.cookie-privacy-message
##.cookie-privacy-notice
##.cookie-privacy-policy-popup
##.cookie-privacy-popup
##.cookie-processed
##.cookie-promo
##.cookie-prompt-container
##.cookie-prompt-wrap
##.cookie-prompt-wrapper
##.cookie-prompt__outer
##.cookie-prompter
##.cookie-question
##.cookie-region
##.cookie-request
##.cookie-request-ctn
##.cookie-revoke-hidden
Expand All @@ -10247,8 +10236,6 @@
##.cookie-rodo
##.cookie-rodo--center
##.cookie-rodo-dialog
##.cookie-rogla-div
##.cookie-rules-wrapper
##.cookie-runway
##.cookie-script-content
##.cookie-set-pop-up
Expand Down Expand Up @@ -10369,8 +10356,6 @@
##.cookie.change-message--on-click
##.cookie.container-fluid
##.cookie.conteudo
##.cookie.cookie-fullfat
##.cookie.cookie-lowfat
##.cookie.custom
##.cookie.fixed
##.cookie.fixed-bottom
Expand Down Expand Up @@ -16273,6 +16258,7 @@ egamersworld.com###cookieBot
fastenal.com###cookieFooterMsg
forbestravelguide.com###cookiePolicyWrap
semiconductor.samsung.com###cookie_component_emea
esa.int###cookie_loc
cvedetails.com###cookieconsentwarningcontainer
emerald.com###cookies-consent
telus.com###cookies-notice-banner
Expand Down Expand Up @@ -17370,6 +17356,10 @@ ezviz.com,hikvision.com##.gdpr-wrapper
festo.com,frandroid.com,giphy.com,idealista.com,idealista.pt,ivoox.com,marianne.net,portail.lotoquebec.com,researchgate.net,rtl.be###didomi-host
clarochile.cl##.cookieModal
bloomberg.co.jp,hitc.com##div[id^="sp_message_container_"]
###pp_b.pp-p
##.wrap > .consent-widget
###cookies.cookies-container
##div[style*="box-shadow: rgb(136, 136, 136) 0px 0px 12px; color: "]
cs.android.com,source.chromium.org###cdk-overlay-0
sprintersports.com##.bottom-0.left-0
haberturk.com##.bottom-14
Expand Down Expand Up @@ -17568,7 +17558,6 @@ carbonite.com###notice
lesoleil.com,livejournal.com,takealot.com##[class^="cookies-banner"]
foxbusiness.com,foxnews.com,vgchartz.com##.notification-banner
easybell.de,foodwatch.org,jku.at,stmwi.bayern.de###cookieman-modal
mojehobby.pl##.message-footer-panel
autotrader.com,coingecko.com,disponivel.com,farmers.com,g2g.com,getmailbird.com,plantnet.org,remove.bg,skokka.com,tjsc.jus.br,unscreen.com##.fixed-bottom
cheddar.com,couchsurfing.com,jumia.ci,jumia.co.ke,jumia.com.dz,jumia.com.eg,jumia.com.ng,jumia.ma,jumia.ug,kaleido.ai,modrinth.com,pluralsight.com,securitylab.github.com,usatoday.com,versobooks.com##.banner
cgtrader.com,delo.si,discordapp.com,dotmailer.com,evgo.com,instreamatic.com,keenfootwear.com,medicalxpress.com,outsideonline.com,phys.org,revolver.news,slovenskenovice.si,socialmediagirls.com,techxplore.com##.notice
Expand Down Expand Up @@ -17732,6 +17721,7 @@ mega.io,mega.nz##.fm-dialog-overlay
mega.io,mega.nz##.overlayed .bottom-page.scroll-block:style(filter: none !important; -webkit-filter: none !important)
germany.travel##body.consent-overlay:style(overflow:auto !important)
germany.travel##.consent
##.js-consent.consent
mediamarkt.de,saturn.de###__tealiumGDPRecModal > #privacy-layer__wrapper
smartphonehoesjes.nl###consent
smartphonehoesjes.nl###consent__overlay
Expand Down Expand Up @@ -17784,6 +17774,9 @@ publico.pt##.site-message--cookies
games.dailymail.co.uk##[class^="CookieBanner"]
arkadium.com##[class^="CookieMessage"]
seatgeek.com##[class^="withGDPRBanner__Wrapper-"]
xe.com##button:has-text(Accept):upward(section)
nature.com##.cc-banner:remove()
link.springer.com##.cc-banner:remove()
cursorinfo.co.il###cmp-iframe
cursorinfo.co.il##body:style(overflow: auto !important)
dpp.cz##.cc
Expand Down Expand Up @@ -18211,6 +18204,7 @@ dfg.de##.bab-modul-cookie-consent
shop.m-budget.migros.ch##.backdrop-filter
galaxus.de##.bnCqgP
galaxus.de##.gIRfBN
postfinance.ch##.ccb
immoscout24.ch##.cmOzGN
verivox.de##.cmp-container
verivox.de##.usercentrics-bg
Expand Down
19 changes: 8 additions & 11 deletions scripts/rebuild-filterlist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,21 @@ async function processDomainSpecificFilterList(listFileName) {
/** @type {FilterlistJSON} */
const filterlistJSON = { rules: {} };

// Remove unsupported rule types:
// Remove comments and network rules, which take a different format:
// ! at start of line indicates comment
// ## at start of line indicates a non-domain-specific rule
// || at start of line indicates network rule
// :remove is uBO syntax for removing an element from the DOM
// :upward is uBO syntax for iterating upward from an anchor element
// redirect-rule is uBO syntax for redirecting a request to a surrogate script
const filteredLines = lines.filter(
(line) =>
!line.startsWith('!') &&
!line.startsWith('##') &&
!line.startsWith('||') &&
!line.includes(':remove') &&
!line.includes(':upward') &&
!line.includes('redirect-rule'),
!line.startsWith('||')
);
// Dump rules into json structure for parsing
for (const rule of filteredLines) {
const splitRule = rule.split('##');
const target = splitRule[0];
const action = splitRule[1];

if (!target || !action) {
if (!action) {
continue;
}

Expand Down Expand Up @@ -89,6 +81,11 @@ async function processDomainSpecificFilterList(listFileName) {
}

const filteredDomains = domains.filter((domain) => {
// Don't filter global rules which don't have a domain
if (domain === '') {
return true;
}

const tlDomain = getDomain(domain);
return domainMap.has(tlDomain);
});
Expand Down

0 comments on commit 891b1a7

Please sign in to comment.