Closed Alex-302 closed 4 years ago
Foreign filters contain invalid rules with :before and :after. We can convert to ::before and ::after instead of removing;
Why do they contain it instead of the proper pseudo-s? Does it work somewhere?
$object-subrequest must be removed? Or converted to the rule without this modifier?
This is simply dangerous, we are risking blocking much more than the rule was supposed to block.
Why do they contain it instead of the proper pseudo-s? Does it work somewhere?
In Ubo
With spar.at##html.has-cookie-notification > body:before
without it
This is simply dangerous, we are risking blocking much more than the rule was supposed to block.
ok
Well, I guess we should simply convert :before
automatically in both the programs and extensions.
removed with removeRulePattern \$cspin filter 232 for ext_android_cb platform
=> $csp in
removed with removeRulePattern #@\$#infilter
[15:27:23][INFO]:Filter 249. Rules 1593 => 1546 =>1265. PlatformPath: 'windows'
=>1265
=> => 1265
Rules with comma separated selectors marked as invalid(they are working at least in AdGuard apps and Chrome extension):
like this
ironmanmag.com.au###iro_banner_lka.com,#meerkat-wrap
:upward()
+ selector
= invalid rule
[15:25:33][ERROR]:Invalid selector: viafree.*##.vjs-playing:upward(1) ~ .no-autoplay-overlay
[15:25:29][ERROR]:Invalid selector: tidningen.nu##span:has-text(/^Annons$/):upward(1) + .textwidget
filter_200_ABPJapaneseFilters
is not ignored "problematic","obsolete"
in metadata;
Converted to invalid rule:
*domains*#@##siteNav:style(transform: none !important;)
=> #@#$#siteNav { transform: none !important; }
Original rule:
beaumontenterprise.com,chron.com,ctpost.com,darientimes.com,fairfieldcitizenonline.com,greenwichtime.com,lmtonline.com,michigansthumb.com,middletownpress.com,milfordmirror.com,mrt.com,myjournalcourier.com,myplainview.com,mysanantonio.com,ncadvertiser.com,newmilfordspectrum.com,newstimes.com,nhregister.com,ourmidland.com,registercitizen.com,seattlepi.com,sfchronicle.com,sfgate.com,sheltonherald.com,stamfordadvocate.com,thehour.com,theintelligencer.com,theridgefieldpress.com,thetelegraph.com,timesunion.com,trumbulltimes.com,westport-news.com,wiltonbulletin.com,yourconroenews.com#@##siteNav:style(transform: none !important;)
Not sure about these rules:
[15:25:10][ERROR]:Invalid selector: kostrzyn.pl#?#.aktperbox:-abp-contains(Rozmaitości) ul[id^="news"] > li[id^="news"].zaj-wrapper:-abp-has(a[href="/aktualnosc-28121-dzienny_dom_senior_na_facebook.html"])
[15:25:20][ERROR]:Invalid rule: telewizja-cyfrowa.com#$?##text-2 > .textwidget > p:nth-of-type(1):has-text(/[\w\W]{337}/):has-text(/Dołącz do 15000\+ osób otrzymujących nasz newsletter. Nie przegapisz żadnej ważnej wiadomości\./) { font-size: 0 !important; }
[15:24:37][ERROR]:Invalid rule: *$xmlhttprequest,redirect-rule=noop.js,domain=otzovik.com
[15:24:37][ERROR]:Invalid rule: ||yastatic.net|yastatic.net|strm.yandex.ru/get/$script,redirect=silent-noeval.js,domain=yandex.ru|yastatic.net
[15:25:09][ERROR]:Invalid rule: *$image,redirect-rule=1x1.gif,domain=youku.com
(redirect-rule
, not redirect
)
$denyallow
, ,denyallow
$redirect=empty
, ,redirect=empty
$popunder
, ,popunder
Well, I guess we should simply convert :before automatically in both the programs and extensions.
fixed
The rules with $all modifier converted to 4 rules:
fixed
Missed spaces in the log: removed with removeRulePattern \$cspin filter 232 for ext_android_cb platform => $csp in
removed with removeRulePattern #@\$#infilter
[15:27:23][INFO]:Filter 249. Rules 1593 => 1546 =>1265. PlatformPath: 'windows' =>1265 => => 1265
fixed
:upward() + selector = invalid rule [15:25:33][ERROR]:Invalid selector: viafree.*##.vjs-playing:upward(1) ~ .no-autoplay-overlay [15:25:29][ERROR]:Invalid selector: tidningen.nu##span:has-text(/^Annons$/):upward(1) + .textwidget
will be fixed when extended css will use new sizzle implementation
Rules with comma separated selectors marked as invalid(they are working at least in AdGuard apps and Chrome extension): like this ironmanmag.com.au###iro_banner_lka.com,#meerkat-wrap
this rule is not marked as invalid
*$xmlhttprequest,redirect-rule=noop.js,domain=otzovik.com
there is no such modifier as redirect-rule
Invalid rule: ||yastatic.net|yastatic.net|strm.yandex.ru/get/$script,redirect=silent-noeval.js,domain=yandex.ru|yastatic.net
we do not support have redirect silent-noeval.js
we do not support have redirect silent-noeval.js
by the way why not
by the way why not
I thought it wasn't added yet, but now I see that it is already added. We would fix validation in the scriptlets library
silent-noeval.js
should be noeval-silent.js
The valid rule is marked as invalid
nczas.com##A[target="_self"] > .vc_single_image-img:last-child, div[id*="970x250"], .checkvisc
Not sure why these rules detected as invalid:
[22:39:20][ERROR]:Invalid rule: ||ad.mail.ru/vast/$redirect=empty
what should we do with redirect=empty
?
[22:40:01][ERROR]:Invalid rule: ||web.archive.org/web/*/http*://*.pl/*$generichide,important,domain=web.archive.org
[22:40:29][ERROR]:Invalid rule: telewizja-cyfrowa.com#$?##text-2 > .textwidget > p:nth-of-type(1):has-text(/[\w\W]{337}/):has-text(/Dołącz do 15000\+ osób otrzymujących nasz newsletter. Nie przegapisz żadnej ważnej wiadomości\./) { font-size: 0 !important; }
looks like valid
[22:40:09][ERROR]:Invalid rule: [Adblock Plus 2.0]
not rule, just ABP metadata
[22:39:20][ERROR]:Invalid rule: ||ad.mail.ru/vast/$redirect=empty what should we do with redirect=empty?
would be considered invalid until this issue is not implemented https://github.com/AdguardTeam/Scriptlets/issues/92
[22:40:01][ERROR]:Invalid rule: ||web.archive.org/web//http://.pl/$generichide,important,domain=web.archive.org
Modifier Generichide cannot be used in blacklist rule
[22:40:09][ERROR]:Invalid rule: [Adblock Plus 2.0]
fixed
[22:40:29][ERROR]:Invalid rule: telewizja-cyfrowa.com#$?##text-2 > .textwidget > p:nth-of-type(1):has-text(/[\w\W]{337}/):has-text(/Dołącz do 15000+ osób otrzymujących nasz newsletter. Nie przegapisz żadnej ważnej wiadomości./) { font-size: 0 !important; }
fixed
nczas.com##A[target="_self"] > .vc_single_image-img:last-child, div[id*="970x250"], .checkvisc
fixed
About #b62af58:
filters
directory(filters and diffs), but they are exists in platforms
;
! Invalid selector:
kostrzyn.pl#?#.aktperbox:-abp-contains(Rozmaitości) ul[id^="news"] > li[id^="news"].zaj-wrapper:-abp-has(a[href="/aktualnosc-28121-dzienny_dom_senior_na_facebook.html"])
It can be converted to AdGuard syntax :contains()
and :has()
;
- no uBO to AdGuard converted rules in
filters
directory(filters and diffs), but they are exists inplatforms
;Screenshot:
Fixed. Added more logs
- not sure why this rule is invalid:
! Invalid selector: kostrzyn.pl#?#.aktperbox:-abp-contains(Rozmaitości) ul[id^="news"] > li[id^="news"].zaj-wrapper:-abp-has(a[href="/aktualnosc-28121-dzienny_dom_senior_na_facebook.html"])
It can be converted to AdGuard syntax
:contains()
and:has()
;
Fixed, ExtendedCss had a small bug
Issues with conversion rules - some rules, which should not be converted, was converted to invalid rules.
Examples:
$
added to the end of rules;
! Rule "intermarche.pl#%#document.cookie = "interapp_redirect=false; path=/;";" converted to: "intermarche.pl#%#document.cookie = "interapp_redirect=false; path=/;";$"
intermarche.pl#%#document.cookie = "interapp_redirect=false; path=/;";
! Rule "ngantukberat.me#%#AG_onLoad(function() { var el=document.querySelector("#wpsafe-link > a[href]");if(el){var elHref=el.href,dest=elHref.split("?safelink_redirect=");dest&&dest[1]&&(window.location=decodeURIComponent(dest[1]))}; });" converted to: "ngantukberat.me#%#AG_onLoad(function() { var el=document.querySelector("#wpsafe-link > a[href]");if(el){var elHref=el.href,dest=elHref.split("?safelink_redirect=");dest&&dest[1]&&(window.location=decodeURIComponent(dest[1]))}; });$"
ngantukberat.me#%#AG_onLoad(function() { var el=document.querySelector("#wpsafe-link > a[href]");if(el){var elHref=el.href,dest=elHref.split("?safelink_redirect=");dest&&dest[1]&&(window.location=decodeURIComponent(dest[1]))}; });
$
added to the end of rules;
! Rule "&pub_redirect=" converted to: "&pub_redirect=$"
&pub_redirect=
! Rule "@@||popsci.com/gdpr.html?redirect=" converted to: "@@||popsci.com/gdpr.html?redirect=$"
@@||popsci.com/gdpr.html?redirect=
css
converted to stylesheet
in domain name
! Rule "csoonline.com,csswizardry.com,cupcakesandcashmere.com##.ad" converted to: "csoonline.com,stylesheetwizardry.com,cupcakesandcashmere.com##.ad"
csoonline.com,csswizardry.com,cupcakesandcashmere.com##.ad
this is the very shorted original rule
- JS rules -
$
added to the end of rules;! Rule "intermarche.pl#%#document.cookie = "interapp_redirect=false; path=/;";" converted to: "intermarche.pl#%#document.cookie = "interapp_redirect=false; path=/;";$" intermarche.pl#%#document.cookie = "interapp_redirect=false; path=/;";
! Rule "ngantukberat.me#%#AG_onLoad(function() { var el=document.querySelector("#wpsafe-link > a[href]");if(el){var elHref=el.href,dest=elHref.split("?safelink_redirect=");dest&&dest[1]&&(window.location=decodeURIComponent(dest[1]))}; });" converted to: "ngantukberat.me#%#AG_onLoad(function() { var el=document.querySelector("#wpsafe-link > a[href]");if(el){var elHref=el.href,dest=elHref.split("?safelink_redirect=");dest&&dest[1]&&(window.location=decodeURIComponent(dest[1]))}; });$" ngantukberat.me#%#AG_onLoad(function() { var el=document.querySelector("#wpsafe-link > a[href]");if(el){var elHref=el.href,dest=elHref.split("?safelink_redirect=");dest&&dest[1]&&(window.location=decodeURIComponent(dest[1]))}; });
- basic rules -
$
added to the end of rules;! Rule "&pub_redirect=" converted to: "&pub_redirect=$" &pub_redirect=
! Rule "@@||popsci.com/gdpr.html?redirect=" converted to: "@@||popsci.com/gdpr.html?redirect=$" @@||popsci.com/gdpr.html?redirect=
fixed
- broken domain in element hiding rule:
css
converted tostylesheet
in domain name! Rule "csoonline.com,csswizardry.com,cupcakesandcashmere.com##.ad" converted to: "csoonline.com,stylesheetwizardry.com,cupcakesandcashmere.com##.ad" csoonline.com,csswizardry.com,cupcakesandcashmere.com##.ad
this is the very shorted original rule
fixed
! Rule "bitly.com,framestr.com,nytimes.com#@#.share-btn" converted to: "bitly.com,subdocumentstr.com,nytimes.com#@#.share-btn" bitly.com,framestr.com,nytimes.com#@#.share-btn wrongly replaced "frame" substring to "subdocument"
fixed
#2fbb7c1
It seems these rules are valid:
[15:36:35][ERROR]:Invalid selector: comingsoon.net##.fixed-header.affix .main-menu-container::after, .main-nav .menu-item:first-child
[15:36:35][ERROR]:Invalid selector: foreignpolicy.com###logo, #menu, #mobile-nav-trigger, #site-wrapper > .scrolled, .-emph.-user.-top.navlink, .hamburger-button, .header-alt-layout .header-subnav .header-menu-item:first-child::before, .header-alt-layout__title
[15:36:35][ERROR]:Invalid selector: foxnews.com##.c-item.c-item-first.c-item-last, .featured.featured-video .control, .featured.featured-video.sticky-video .contain .info .title::before, .g-41.section-featured, .vid-scroll-bknd
[15:36:35][ERROR]:Invalid selector: globalnews.ca##.sticky-wrapper.sticky .stickyiframe-container::after, .stickyiframe-title-bar
[15:36:35][ERROR]:Invalid selector: msn.com###header-common::before, #sticky-footer, #stickyTitleBar, #subfoot, .loaded.next.paddle, .loaded.previous.paddle, .show.floatingfeedback, .spotlight-1 > div[style="height: 50px;"], .start.animate.close-mini
[15:36:35][ERROR]:Invalid selector: theatlantic.com##.t-homepage .c-nav--slim--lacroix::after, .t-homepage .c-nav__list--slim--lacroix .c-nav__item--small-a--lacroix
[15:37:12][ERROR]:Invalid selector: victoriatornegren.se##article[id^="post-"]:has(.entry-header:has-text(/(?:samarbete|Samarbete)\s+med/i))
[15:36:35][ERROR]:Invalid selector: comingsoon.net##.fixed-header.affix .main-menu-container::after, .main-nav .menu-item:first-child
[15:36:35][ERROR]:Invalid selector: foreignpolicy.com###logo, #menu, #mobile-nav-trigger, #site-wrapper > .scrolled, .-emph.-user.-top.navlink, .hamburger-button, .header-alt-layout .header-subnav .header-menu-item:first-child::before, .header-alt-layout__title
[15:36:35][ERROR]:Invalid selector: foxnews.com##.c-item.c-item-first.c-item-last, .featured.featured-video .control, .featured.featured-video.sticky-video .contain .info .title::before, .g-41.section-featured, .vid-scroll-bknd
[15:36:35][ERROR]:Invalid selector: globalnews.ca##.sticky-wrapper.sticky .stickyiframe-container::after, .stickyiframe-title-bar
[15:36:35][ERROR]:Invalid selector: msn.com###header-common::before, #sticky-footer, #stickyTitleBar, #subfoot, .loaded.next.paddle, .loaded.previous.paddle, .show.floatingfeedback, .spotlight-1 > div[style="height: 50px;"], .start.animate.close-mini
[15:36:35][ERROR]:Invalid selector: theatlantic.com##.t-homepage .c-nav--slim--lacroix::after, .t-homepage .c-nav__list--slim--lacroix .c-nav__item--small-a--lacroix
fixed, rules were wrongly sent into extended CSS validator
[15:37:12][ERROR]:Invalid selector: victoriatornegren.se##article[id^="post-"]:has(.entry-header:has-text(/(?:samarbete|Samarbete)\s+med/i))
this rule is invalid because braces inside :has
should be escaped
https://github.com/AdguardTeam/FiltersCompiler/issues/93#issuecomment-700689101
these works fine in uBo and can be used as softer ,badfilter
of these in EasyList:
@@||web.archive.org^$ghide
EL rejected remove filter and I don't needed disable rule at all, I disabled for "Polish range" in archive to hide more cookies modals/bars without readdress by add specific for web.archive.org
.
This seems better to me than converting to regex with ".pl
" excluded:
@@||web.archive.org^$ghide,badfilter
@@/web\.archive.org/.*/.*(?!\.pl)/$ghide
!
! regex is draft / in pseudocode to show as maybe possible address too in AG
:before
and:after
. We can convert to::before
and::after
instead of removing;$object-subrequest
must be removed? Or converted to the rule without this modifier?~$all
modifier converted to 4 rules:Screenshot: