Repository navigation
Have linter skip checking pre-parsing directives returning false in uBO #2964
Description
Prerequisites
- I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
- This is NOT an issue with YouTube, Facebook or Twitch.
- This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
- I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
- The issue is not present after disabling uBO in the browser.
- I checked the documentation to understand that the issue I am reporting is not normal behavior.
I tried to reproduce the issue when...
- uBO is the only extension.
- uBO uses default lists and settings.
- using a new, unmodified browser profile.
Description
While I love that the list syntax error checker has been available in regular resource viewing (Previously it was only in specific configurations of the logger), and that it has made my list-work easier, I've noticed one thing that is making it more tricky to find genuine syntax errors in some of my larger lists.
Using https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Dandelion%20Sprout's%20Anti-Malware%20List.txt as the example list for this report, the logger shows 65 errors as of 17th of November 2023, but all of them are packed inside !#if sections that indicate that those entries weren't intended for uBO in the first place. I fairly often use !#if !ext_ublock for AdGuard-only syntaxes (Mostly $network and $app), and !#if false for ABP workarounds.
As such, having the error counter not include entries that are in those 2 types of sections, would've been splendid stuff.
A specific URL where the issue occurs.
chrome-extension://cjpalhdlnbpafiamejdnhcphjbkeiagm/asset-viewer.html?url=https%3A%2F%2Fraw.githubusercontent.com%2FDandelionSprout%2Fadfilt%2Fmaster%2FDandelion%2520Sprout%27s%2520Anti-Malware%2520List.txt
Steps to Reproduce
- Import https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Dandelion%20Sprout's%20Anti-Malware%20List.txt as a custom filter.
- See that the error counter in the upper right is circa 65.
- Go through the error counter's arrows and see that all or virtually all of those 65 are packed into "Not for use in uBO"
!#ifsections.
Expected behavior
That the error checker doesn't include entries in its count that are inside !#if !ext_ublock and !#if false sections.
Actual behavior
The error checker doesn't check for !#if or !#endif, making it slightly harder and more crowded to look for actually incorrect syntaxes and misspellings.
uBO version
1.53.0
Browser name and version
Chrome 119.0.6045.125 x64
Operating System and version
Windows 11 23H2 x64

Activity
krystian3w commentedon Nov 17, 2023
Real case by newbies: olegwukr/polish-privacy-filters#146
[-]Make the resource viewer's error checker discard entries that are inside "!#if !ext_ublock" and "!#if false" sections[/-][+]Make the resource viewer's error checker not check entries that are inside "!#if !ext_ublock" and "!#if false" sections[/+]u-RraaLL commentedon Dec 23, 2023
It should skip checking all pre-parsing directives that return
falsein uBO, not just these specific two.[-]Make the resource viewer's error checker not check entries that are inside "!#if !ext_ublock" and "!#if false" sections[/-][+]Have linter skip checking pre-parsing directives returning false in uBO[/+]krystian3w commentedon Dec 28, 2023
IMO
env_legacytoo if someone offer support PaleMoon and Basilisk e.g.: