-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested procedural filtering into :has()
did not works
#2228
Comments
@krystian3w this should be detected. Probably new implementation does not throw errors when fed with syntax which is not valid natively. Y: |
MDN says:
So |
Why close? This needs fixing. |
I meant no possible fix on addon level. |
I need to investigate what can be done. |
…n CSS selector Related issue: - uBlockOrigin/uBlock-issues#2228
If I correct checked latest stable 105 release of Chrome has landed with enabled So Google community tries test of implementation on whole people (not on only beta, dev and canary level). |
|
Also both no implement read Firefox also no implemented:
Chrome ignore/no implemented:
|
Will uBO uses native :has if possible? |
Yes, that's the goal, it's already the case and it's actually why the issue exist here given that |
I didn't expect Chrome 105 to reach stable already. I will have to do something to fix this and publish a 1.44.2 revision. |
Related issue: - uBlockOrigin/uBlock-issues#2228 Using `#?#` (instead of `##` for a procedural cosmetic filter will prevent uBO from trying to convert the filter into a declarative one.
The chosen solution is for filter authors to force the parsing of a filter as procedural by using That said, |
Will |
Any potentially procedural operator, so also |
I do expect the need to use |
What about older rules? Do they all need to be tested again? Can uBO warn in the syntax highlighter that this rule might need |
This comment was marked as outdated.
This comment was marked as outdated.
I detected teach browser be add-on how read child's: firefox_udQvjabKc5.mp4! https://codepen.io/bramus/pen/MWEvKEg
cdpn.io#?#figure:has(figcaption) img:style(outline: 10px dashed red;) Without these teach, Mozilla fail don't stylize second image. |
I can reproduce the issue with Firefox with your filter once
I don't understand that sentence, what is teach? |
Mozilla based on devtools ignored has selector and matches second image without figcaption parent. So uBo temporary teach demo how don't match false positives. This maybe glitch similar to unhide node. |
So |
But hopefully not enabled for any groups:
We can still fight for this piece of bread. But I don't see light to implement error for nesting. |
I detected new regression in works ! works simple negation
private-company-webapp.org##table td:has-text(employee1) ~ td:not([class*="day_off"]):style(border-top: 5px solid green)
!
! Both have broken `:not()`
private-company-webapp.org#?#table td:has-text(employee1) ~ td:not([class*="day_off"]):style(border-top: 5px solid green)
private-company-webapp.org#$?#table td:has-text(employee1) ~ td:not([class*="day_off"]) { border-top: 5px solid green } The negation in enforced procedural and AdGuard syntax are cleared to empty brackets in use (possible see this in uBo logger). Also then no works disable broken filter by Author mode form advance settings (due no match with raw database?). Minimal demo (PoC due company app is not public): IMO maybe possible fix instead rewrite filter or back to mixed declarative state. |
I'm on FireFox 104.0.1 ( |
The new parser no longer uses the browser DOM to validate that a cosmetic filter is valid or not, this is now done through a JS library, CSSTree. This means filter list authors will have to be more careful to ensure that a cosmetic filter is really valid, as there is no more guarantee that a cosmetic filter which works for a given browser/version will still work properly on another browser, or different version of the same browser. This change has become necessary because of many reasons, one of them being the flakiness of the previous parser as exposed by many issues lately: - uBlockOrigin/uBlock-issues#2262 - uBlockOrigin/uBlock-issues#2228 The new parser introduces breaking changes, there was no way to do otherwise. Some current procedural cosmetic filters will be shown as invalid with this change. This occurs because the CSSTree library gets confused with some syntax which was previously allowed by the previous parser because it was more permissive. Mainly the issue is with the arguments passed to some procedural cosmetic filters, and these issues can be solved as follow: Use quotes around the argument. You can use either single or double-quotes, whichever is most convenient. If your argument contains a single quote, use double-quotes, and vice versa. Additionally, try to escape a quote inside an argument using backslash. THis may work, but if not, use quotes around the argument. When the parser encounter quotes around an argument, it will discard them before trying to process the argument, same with escaped quotes inside the argument. Examples: Breakage: ...##^script:has-text(toscr') Fix: ...##^script:has-text(toscr\') Breakage: ...##:xpath(//*[contains(text(),"VPN")]):upward(2) Fix: ...##:xpath('//*[contains(text(),"VPN")]'):upward(2) There are not many filters which break in the default set of filter lists, so this should be workable for default lists. Unfortunately those fixes will break the filter for previous versions of uBO since these to not deal with quoted argument. In such case, it may be necessary to keep the previous filter, which will be discarded as broken on newer version of uBO. THis was a necessary change as the old parser was becoming more and more flaky after being constantly patched for new cases arising, The new parser should be far more robust and stay robist through expanding procedural cosmetic filter syntax. Additionally, in the MV3 version, filters are pre-compiled using a Nodejs script, i.e. outside the browser, so validating cosmetic filters using a live DOM no longer made sense. This new parser will have to be tested throughly before stable release.
I see breakage in uBo dev with
Workaround can be use IMO not related with experimental Also no checked use Maybe works Fine in Firefox 104 and 106 (so can be 105 bug). |
:has()
no works:has()
did not works
…n CSS selector Related issue: - uBlockOrigin/uBlock-issues#2228
Related issue: - uBlockOrigin/uBlock-issues#2228 Using `#?#` (instead of `##` for a procedural cosmetic filter will prevent uBO from trying to convert the filter into a declarative one.
Latest uBo dev have if condition when found: foo.who##a, b:has(c) Because simple CSS hide any In short I mean CSS didn't followed content blockers decision. |
uBO should follow the expected result in CSS. With the previous parser there was not much motivation to do so because of all the added code complications, but this comes free with the new parser. At this point I think I prefer to leave this to another dev build cycle though. |
I think this can be regression in deprecated syntax:
If page don't have In real cases regression will break pages like |
|
Prerequisites
I tried to reproduce the issue when...
Description
Nested has like:
will no longer works with Chrome 105 after stable release if Google community no implement better native
has
in CSS.So I reccomend mediation with Big "corporations" after bugs form console no looks to fix in Addons. I leave it free to throw this into the chromium and Firefox bugtrackers.
AdguardTeam/ExtendedCss#149
This can be too regresion after implement mix
has
withstyle
#382 or fix Yuki issue #2170AdGuard Base sometimes use
domain.tld##foo:has(bar:has-text(word))
; I don't checked this in uBo stock list or Regional.A specific URL where the issue occurs
example.org
/example.com
Steps to Reproduce
layout.css.has-selector.enabled
in Firefox have same troubles - so can break filters in 2023/2024 after publish function as stable (for now have some glitches, so maybe Moz://a implement something to change nothing in uBo code)Paste filter from description to My Filters (or elmenet picker (with omit domain) - as later step).
Open one of two demo Internet pages.
Expected behavior
Website should be "blank".
Actual behavior
Website isn't "blank".
uBlock Origin version
1.44.1b1
Browser name and version
Firefox 103, Opera 91+, Chrome 105+
Operating System and version
Windows 7/10
The text was updated successfully, but these errors were encountered: