Skip to content

Wildcard path matching for scriptlet filters doesn't seem to work #4178

Closed as not planned

Description

@tan-x-y

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

Static network filters can use wildcards within URL paths, eg:

||example.com/*/bar^

However, an equivalent path restriction doesn't appear to work with scriptlets:

example.com/*/bar##+js()

A specific URL where the issue occurs.

example.com/foo/bar

Steps to Reproduce

  1. Create a scriptlet filter using wildcard in the hostname/path, eg.: example.com/*/bar##+js().
  2. Visit a matching url
  3. Observe that the filter is not applied in the logger

Expected behavior

Support wildcard path matching similar to static network filters

Troubleshooting information

uBlock Origin: 1.75.0
Chromium: 156
filterset (summary):
 network: 254379
 cosmetic: 44279
 scriptlet: 38567
 html: 0
listset (total-discarded, last-updated):
 default:
  user-filters: 0-0, never
  ublock-filters: 54466-96, now
  ublock-badware: 11048-17, now
  ublock-privacy: 4182-4, now
  ublock-unbreak: 2848-1, now
  ublock-quick-fixes: 737-0, now
  easylist: 82333-499, now
  easyprivacy: 56937-752, now
  urlhaus-1: 122620-11, now
  plowe-0: 3563-0, now
filterset (user): [empty]
userSettings: [none]
hiddenSettings: [none]
supportStats:
 allReadyAfter: 2423 ms
 maxAssetCacheWait: 9 ms
 cacheBackend: indexedDB

Activity

  1. freezer2022 commented on Oct 28, 2026

    @freezer2022
    • I checked the documentation to understand that the issue I am reporting is not normal behavior.

    Already possible by using a regex, for ex: /example\.com\/.*\/bar/##+js()


    example.com/toto##h1
    /example\.com\/toto\d+/#@#h1
    

    I don't know whether the support for wildcard * is going to be implemented (for the sake of easiness compared to a regex) or it will be declined as "use the regex".


    By the way, it seems that an empty/void scriptlet should be marked as invalid in the parser, shouldn't it?: example.com##+js() (but not the exceptions of course: example.com#@#+js() or #@#+js())

  2. gorhill commented on Oct 28, 2026

    @gorhill
    Member

    example.com/*/bar##+js()

    Because that's not valid syntax. Use regex-based syntax as suggested above if you want to use wildcard. Refer to documentation for valid syntax: https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#static-extended-filtering

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