Skip to content

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

Open

Description

@DandelionSprout

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

Activity

  1. krystian3w commented on Nov 17, 2023

    @krystian3w
  2. ghost added
    enhancementNew feature or request
    on Nov 17, 2023
  3. 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[/+] on Nov 18, 2023
  4. u-RraaLL commented on Dec 23, 2023

    @u-RraaLL
    Contributor

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

  5. 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[/+] on Dec 23, 2023
  6. krystian3w commented on Dec 28, 2023

    @krystian3w

    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 chance to corectly popup blocking – other 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" from button/link) and
    • set-cookie was not copied (need fork).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions