uBlock-for-firefox-legacy icon indicating copy to clipboard operation
uBlock-for-firefox-legacy copied to clipboard

Some rules doesn't work at all

Open THEtomaso opened this issue 5 years ago • 17 comments

Reference: https://github.com/DandelionSprout/adfilt/issues/7/#issuecomment-503587322

Apparently this is because of "deprecated pseudo operators": https://github.com/gorhill/uBlock/issues/3683/

Note: I don't think this can be remedied by the convertion script, because some of the deprecated syntaxes are still commonly used (and works) with certain types of rules.

THEtomaso avatar Feb 10 '20 21:02 THEtomaso

Need repair node detection as no longer exist:

https://github.com/uBlockOrigin/uBlock-issues/issues/341

krystian3w avatar Feb 20 '20 21:02 krystian3w

Well, this should be backported by someone who understands the magic of selectors well and is familiar with the code base.

JustOff avatar Feb 20 '20 21:02 JustOff

@THEtomaso Could you please take a look at uBlock0_1.16.4.22b3.firefox-legacy.xpi.zip which is based on PR #239? You can leave your feedback here or there.

JustOff avatar Jun 29 '20 12:06 JustOff

The issue that I refered to in my first post here (@ resett.no) isn't relevant anymore.

But I tested against the example posted by krystian3w (@ cooking.nytimes.com), which hawkeye116477 refered to in his PR.. It seems to work just fine now, in uBO Legacy v1.16.4.22b3. In comparison, with previous builds, the rule is completely disregarded, and doesn't even show up in the logger! Indeed, it looks like another successful fix to me. Good work you guys! :+1:

THEtomaso avatar Jun 29 '20 17:06 THEtomaso

In comparison, with previous builds, the rule is completely disregarded, and doesn't even show up in the logger!

It uBO 1.16.21 wasn't supposed to appear because it blocked the login button (it stopped working).

cooking.nytimes.com in report issue you can found https://github.com/uBlockOrigin/uAssets/issues/3708#issuecomment-429635491 the reason why the simple filter is being withdrawn, :if-not() generate same bug without fix "broken" nodes.


To prevent the legacy working, a record was used:

    :not(:has()) - and uBO 1.16.21 ommit that filter as invalid

instead of :if-not(), which would still spoil the login button in uBO 1.16.x (without repair nodes a.k.a. #239).

krystian3w avatar Jun 30 '20 05:06 krystian3w

@krystian3w I wish I could understand what you meant, and whether we should do something about it, but I can't :sunglasses:

JustOff avatar Jun 30 '20 09:06 JustOff

Nothing to fix in 1.16.22b3 - I tried to explain why filters were not visible in the logger (uBO 1.16.21) so far and why syntax was used to pretend to be CSS4 (:not(:has()) instead of :if-not).

krystian3w avatar Jun 30 '20 10:06 krystian3w

AIUI, the rules in question here were invisible in the logger because uBO Legacy didn't support them, and therefore they weren't applied. The problem with invisible rules that ARE applied, is a different issue all together!: https://github.com/gorhill/uBlock-for-firefox-legacy/issues/91/ Example: ##iframe[src*="annonse"] breaks this page: https://www.dagbladet.no/annonse/70179055/ ..but the rule is not visible in uBO Legacy's logger!

THEtomaso avatar Jun 30 '20 10:06 THEtomaso

Parser omit filter to use :not(:has()) / :not(:has-text()) in uBO 1.16.21 and this is not same problem as invisible some "simple" generic filters.

A filter classified as incorrect is not repaired by the parser for use (so newer show in logger).

--

Unless you try say "I don't see such a filter in the logger after updating to beta":

Przechwytywanie

other story is translate :if-not() to :not() and classifying content that is verifiable without using :has() (in the filter) when the filter is not a simple CSS2.1 or CSS3 compliant - https://github.com/uBlockOrigin/uBlock-issues/issues/612.

krystian3w avatar Jun 30 '20 10:06 krystian3w

Well, that's another thing.. As you pointed out; uBO 1.17.4 apparently converted the unsupported :not(:has rule into :if-not. However, during my testing, uBO Legacy didn't seem to attempt such a conversion, but rather chose to completely disregard the rule instead. Anyhow, the issue appears to be fixed now, so none of this probably matters anymore! :)

THEtomaso avatar Jun 30 '20 11:06 THEtomaso

As you pointed out; uBO 1.17.4 apparently converted the unsupported :not(:has rule into :if-not.

I don't know what was doing in such an old web-ext (or chromium) uBO, but the latest one is the other way around:

    :if-not() translated into :not()

":has()" doesn't added it in (as translation is visible in uBO logger), but silent use :has() if browser don't support selector embeded in "()".

Theoretically, it can be such an "improvement" ("feature"), because in AdGuard such a simplified filter is further omitted.

krystian3w avatar Jun 30 '20 11:06 krystian3w

It seems the last significant change related to this issue is to port https://github.com/gorhill/uBlock/commit/8a88e9d93174badd6855c0e782737158c9ccd6f8 from upstream. @hawkeye116477, perhaps you want to try to take on this task too?

JustOff avatar Jul 04 '20 09:07 JustOff

@JustOff I already did that, I have that locally. I'll test that again and I'll send PR later.

hawkeye116477 avatar Jul 04 '20 10:07 hawkeye116477

@THEtomaso Could you please take a look at uBlock0_1.16.4.23b1.firefox-legacy.xpi.zip which is based on PR #240? You can leave your feedback here or there.

JustOff avatar Jul 04 '20 12:07 JustOff

At least, I can confirm that youtube.com#@?##masthead-ad works for whitelisting YT's premium banner now, although it didn't work in the previous legacy build! :)

--

EDIT: And deviantart.com##path[transform="rotate(-180 12 12.5)"]:nth-ancestor(4) now effectivelly removes DeviantArt's annoying scroll-to-top floater! :+1:

THEtomaso avatar Jul 04 '20 13:07 THEtomaso

Quest for those willing, port https://github.com/gorhill/uBlock/commit/c33de41660de0b7c982a40f4bfde31f32180a2ee :smile:.

hawkeye116477 avatar Aug 11 '20 11:08 hawkeye116477

Linked filter now break page - maybe AdamWr add exclusion to avoid run for logged users.

krystian3w avatar Sep 16 '22 06:09 krystian3w