Skip to content

Show error when using deprecated/removed remove-attr scriptlet #4142

Description

@Stevoisiak

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 a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • 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

Filter rules that use the removed/deprecated scriptlets for remove-attr or remove-class don't show an error when used in custom filters, even though they do not work in the current version of uBO.

Image

A specific URL where the issue occurs.

extension://odfafepnkmbhccpbejgmiehpchacaeak/dashboard.html#1p-filters.html

Steps to Reproduce

  1. Open "My Filters" in uBO dashboard
  2. Add the following filters
    example.com##+js(remove-attr, href, .logo)
    example.com##+js(remove-class, .element, some-class-name)
    

Expected behavior

Show an error explaining that the scriptlet is deprecated or highlight the scriptlet name in yellow, like any other invalid scriptlet name.

Related note: AdGuard still uses the scriptlet format for removing classes and attributes and does not support :remove-attr() or remove-class(), meaning these filters are not cross-compatible between uBO and Adguard. See AdguardTeam/AdguardBrowserExtension#3538 and AdguardTeam/SafariConverterLib#123

Troubleshooting information

uBlock Origin: 1.75.0
Chromium: 154
filterset (summary):
 network: 185501
 cosmetic: 137023
 scriptlet: 48947
 html: 0
listset (total-discarded, last-updated):
 removed:
  plowe-0: null
 added:
  https://codeberg.org/just_a_husk/uBlockOrigin-AI-Blocklist/raw/branch/main/list.txt: 15977-0, 2h.26m
  https://raw.githubusercontent.com/Stevoisiak/Annoyance-Blocklist/refs/heads/main/annoyance-blocklist.txt: 327-0, 2h.27m
  https://raw.githubusercontent.com/alvi-se/ai-ublock-blacklist/refs/heads/master/list.txt: 2741-120, 2h.26m
  fanboy-cookiemonster: 48193-124, 21h.27m
  ublock-cookies-easylist: 5855-107, 21h.27m
  fanboy-social: 17992-69, 2d.1h.45m
  fanboy-thirdparty_social: 69-0, 1d.22h.28m
  adguard-mobile-app-banners: 8002-19, 3d.22h.11m
  easylist-newsletters: 9628-30, 21h.27m
  easylist-notifications: 2557-448, 21h.27m
 default:
  user-filters: 2-0, never
  ublock-filters: 53628-88, 1d.11h.28m Δ
  ublock-badware: 10324-17, 1d.11h.28m Δ
  ublock-privacy: 4169-3, 1d.11h.28m Δ
  ublock-unbreak: 2834-1, 1d.11h.28m Δ
  ublock-quick-fixes: 563-0, 4h.27m Δ
  easylist: 85311-145, 1d.11h.28m Δ
  easyprivacy: 56744-49, 1d.11h.28m Δ
  urlhaus-1: 47840-11, 5h.27m
filterset (user): [array of 2 redacted]
trustedset:
 added: [array of 12 redacted]
 removed:
  chrome-extension-scheme
switchRuleset:
 added: [array of 3 redacted]
userSettings:
 advancedUserEnabled: true
 userFiltersTrusted: true
hiddenSettings:
 trustedListPrefixes: ublock- https://raw.githubusercontent.com/Stevoisiak/
supportStats:
 allReadyAfter: 446 ms (selfie)
 maxAssetCacheWait: 245 ms
 cacheBackend: indexedDB

Activity

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

    invalidnot a uBO issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions