-
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
Properly report :spath
operator of procedural cosmetic filters in logger
#453
Comments
In
|
Also strange is exception with |
|
Yep, this is it.
But I still want to know if |
? You mean, something like this: |
Yes, I need remove "
no recover avatars: |
Don't use |
I am no use, Logger "recommed" exception with spath. |
Sorry for having closed this too fast yesterday, I was tired and didn't understand properly the reported issue. So the first problem is that uBO reports
On the front page of |
No problem, worse should by banned in repo. |
Comma separated filters are displayed in logger, but are ignored (not applied to page) Clarification: first filter from comma-separated list is applied, second filter is ignored. |
I tested the comma case, and I was surprised that it was handled without exception -- though I have no clue whether the result make sense (quite probably not). Given that fixing this is less trivial than fixing the logger reporting (which fix I felt was safe to include in current release candidate) , I prefer to fix this separately as another issue, not to be fixed for the next release. |
What I tried was: Avatar is hidden, labels are not. Filter is not logged as invalid in the logger. Filter ending with comma is logged as invalid ( |
I spent some time looking into this. Here is what is happening. When an "spath" is appended to a procedural operator chain, here is what uBO internally does: Create a plain CSS selector matching the nodes selected as a result of the procedural operator. The CSS selector is of the form Then the plain CSS selector is appended to this
The 3rd-form will be detected as invalid. However the 1st and 2nd form will be detected as valid. uBO could detect the 1st form easily and discard it as invalid. The 2nd form however can't be trivially detected -- this would require uBO to create some sort of CSS parser just to handle this. Because of this, I've decided I won't add code to care about commas for such cases. In the end, I consider that using commas in the middle or end of a procedural operator chain is contrived (in the case here this was used only to show an issue with logger output), and the result should be assumed to be undefined. |
:spath
operator of procedural cosmetic filters in logger
Prerequisites
Description
Block someting with xpath and use comma after xpath:
github.com###issue-418448972:xpath(..), blablacar
Try find logger and you found:
Logger output
https://github.com/uBlockOrigin/uBlock-issues/issues/453
A specific URL where the issue occurs
#453
Steps to Reproduce
:spath
operator of procedural cosmetic filters in logger #453##.js-comment-body:xpath(..), blablacar
##.js-comment-body:xpath(..):spath(, blablacar)
Expected behavior:
mark filter as invalid?
or add works exception + marks spath as valid operator:
#@##issue-418448972:xpath(..):spath(, li)
Actual behavior:
other selector moved to
:spath(...)
to not discard filter? and expception without remove spath does not work.Your environment
The text was updated successfully, but these errors were encountered: