Skip to content
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

Have linter skip checking pre-parsing directives returning false in uBO #2964

Open
9 tasks done
DandelionSprout opened this issue Nov 17, 2023 · 3 comments
Open
9 tasks done
Labels
enhancement New feature or request

Comments

@DandelionSprout
Copy link

DandelionSprout commented Nov 17, 2023

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.

image

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

  1. Import https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Dandelion%20Sprout's%20Anti-Malware%20List.txt as a custom filter.
  2. See that the error counter in the upper right is circa 65.
  3. 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" !#if sections.

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

@krystian3w
Copy link

Real case by newbies: olegwukr/polish-privacy-filters#146

@gwarser gwarser added the enhancement New feature or request label Nov 17, 2023
@DandelionSprout DandelionSprout changed the title 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 Nov 18, 2023
@u-RraaLL
Copy link
Contributor

It should skip checking all pre-parsing directives that return false in uBO, not just these specific two.

@u-RraaLL u-RraaLL changed the title 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 Dec 23, 2023
@krystian3w
Copy link

krystian3w commented Dec 28, 2023

IMO env_legacy too if someone offer support PaleMoon and Basilisk e.g.:

!#if env_legacy
lento.pl##script:contains(showNotify())
!#endif

Due PreHTML filtering have chances of popup blocking – fails:

  • remove-attr.js (the page is too small to analyze the difference between the pop-up after loaded the page (≈DOMContentLoaded) and the one with onclick="foo") and
  • set-cookie was not copied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants