Skip to content

JSONPath: Bracketed filter valid in JSONPath tool but not in filter #4052

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

I have two JSON filters which work on their own

www.pixiv.net##+js(json-edit-fetch-response, v2:$.body.illusts)
www.pixiv.net##+js(json-edit-fetch-response, v2:$.body.manga)

In the JSONPath tool, if I combine said filters together with brackets it appears to work

v2:$.body.['manga','illusts']

However, if I add this combined expression as a filter it has no effect on the page.

www.pixiv.net##+js(json-edit-fetch-response, v2:$.body.['manga','illusts'])

(It's worth noting an online evaluator lists the bracketed version as invalid JSONPath.)

A specific URL where the issue occurs.

https://www.pixiv.net/en/users/120961088

Steps to Reproduce

  1. Open JSONPath tool.
  2. Enter JSON Data from gist.
  3. Input expression v2:$.body.['manga','illusts']. Observe that results are filtered.
  4. Add filter for www.pixiv.net##+js(json-edit-fetch-response, v2:$.body.['manga','illusts'])
  5. Go to https://www.pixiv.net/en/users/120961088. Observe that items are filtered.

Expected behavior

The results from the JSONPath tool match the results I see on the page. In other words, either

Option A: The JSONPath tool shows v2:$.body.['manga','illusts'] as an invalid filter.

Option B: Images on the linked URL are filtered, as indicated by the JSONPath tool.

Troubleshooting information

uBlock Origin: 1.72.0
Chromium: 150
filterset (summary):
 network: 181105
 cosmetic: 43260
 scriptlet: 36329
 html: 0
listset (total-discarded, last-updated):
 added:
  https://raw.githubusercontent.com/Stevoisiak/Annoyance-Blocklist/refs/heads/main/annoyance-blocklist.txt: 59-0, 2d.6h.22m
 default:
  user-filters: 1-0, never
  ublock-filters: 51859-87, 2h.46m Δ
  ublock-badware: 10270-27, 2h.46m Δ
  ublock-privacy: 4070-4, 2h.46m Δ
  ublock-unbreak: 2776-1, 2h.46m Δ
  ublock-quick-fixes: 468-0, 2h.46m Δ
  easylist: 85129-485, 2h.46m Δ
  easyprivacy: 55927-713, 2h.46m Δ
  urlhaus-1: 48080-11, 3h.46m
  plowe-0: 3513-0, 4d.5h.45m
filterset (user): [array of 1 redacted]
switchRuleset:
 added: [array of 1 redacted]
userSettings: [none]
hiddenSettings: [none]
supportStats:
 allReadyAfter: 910 ms (selfie)
 maxAssetCacheWait: 200 ms
 cacheBackend: indexedDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions