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

Add warnings in uBO's logger when a list contains non-equal amounts of "!#if" and "!#endif" lines #1712

Closed
8 tasks done
DandelionSprout opened this issue Sep 10, 2021 · 1 comment
Labels
enhancement New feature or request fixed issue has been addressed

Comments

@DandelionSprout
Copy link

DandelionSprout commented Sep 10, 2021

Prerequisites

I tried to reproduce the issue when...

  • uBO is the only extension
  • uBO with default lists/settings
  • using a new, unmodified browser profile

Description

When maintaining many of my filterlists, I occasionally run into situations where various entries don't seem to be applied at all on sites. It usually takes me circa 20 confused minutes of trial and error, before I try to use text detection in Sublime Text to determine that the amount of !#if and !#endif in one of my lists are different, which have a potential to cause all sorts of strange outcomes.

The recentmost instance where this has occured, is DandelionSprout/adfilt@7a5723e#diff-a14148d2e31f07a82f24fb4c6818e12a7a74e377731e1ba0d0417ded00b3da75, where I had previously managed to deactivate several hundred entries.

I therefore wish for uBO's logger's error messages (which normally are about "Invalid network filter in" and "​Invalid extended filter in"), to receive a new kind of error message along the lines of "Warning: example-filename.txt contains an unequal amount of !#if and !#endif". This will assist me when debugging problems with my 135 lists.

A specific URL where the issue occurs

chrome-extension://cgbcahbpdhpcegmbfconppldiemgcoii/logger-ui.html?popup=1#0

Steps to Reproduce

There's not really any objective ways to reproduce this, but I'll try to write down a bare-basic method:

  1. Write a new sandbox list with the following entries:
! Title: Unequal !#if and !#endif test
! Version: 10September2021v1-Sandbox
!#if adguard
!#if ext_ublock
theguardian.com##.pillar-link--Opinion
!#endif
theguardian.com##.pillar-link--News
theguardian.com##.pillar-link--Sport
theguardian.com##.pillar-link--Culture
theguardian.com##.pillar-link--Lifestyle
  1. For the purposes of this test, pretend like the solution to the above is not immediately evident, and that the problem involves a hypothetical 5,000-entry list with 25 !#if tags and 23 !#endif tags.
  2. Visit https://www.theguardian.com/international and see that none of the five buttons of the main category taskbar are removed.
  3. Open uBO's logger, set the tab to "All", and resync all lists.
  4. The logger does not show any warnings about the unequal amounts of !#if and !#endif in that list.

Expected behavior

Some or another way for uBO to identify and warn about lists that have unequal amounts of "!#if" and "!#endif" lines.

Actual behavior

There is currently no way that I'm aware of for uBO to identify and warn about lists that have unequal amounts of "!#if" and "!#endif" lines.

uBlock Origin version

1.37.3b21

Browser name and version

Vivaldi 4.1.2369.21 x64

Operating System and version

Windows 10 21H1 x64

@gorhill
Copy link
Member

gorhill commented Sep 10, 2021

Related, #1134:

  • Detect unmatched !#if-!#endif directives

@uBlock-user uBlock-user added the enhancement New feature or request label Sep 10, 2021
gorhill added a commit to gorhill/uBlock that referenced this issue Dec 15, 2023
@MasterKia MasterKia added the fixed issue has been addressed label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

4 participants