JSONPath: Bracketed filter valid in JSONPath tool but not in filter
### Prerequisites
- [x] 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](https://github.com/uBlockOrigin/uAssets/issues).
- [x] This is **NOT** a [_YouTube_](https://www.github.com/uBlockOrigin/uAssets/issues/30157), [_Facebook_](https://www.github.com/uBlockOrigin/uAssets/issues/3367) or [_Twitch_](https://www.github.com/uBlockOrigin/uAssets/issues/5184) report. _These sites MUST be reported by clicking their **respective links**_.
- [x] This is not a support issue or a question. For support, questions, or help, visit [/r/uBlockOrigin](https://www.reddit.com/r/uBlockOrigin/).
- [x] I performed a [cursory search of the issue tracker](https://github.com/uBlockOrigin/uBlock-issues/issues?q=is%3Aissue) to avoid opening a duplicate issue.
- [x] The issue is not present after disabling uBO in the browser.
- [x] I checked the [documentation](https://github.com/gorhill/uBlock/wiki) to understand that the issue I am reporting is not normal behavior.
### I tried to reproduce the issue when...
- [x] uBO is the only extension.
- [x] uBO uses default lists and settings.
- [x] 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](https://jsonpath.com/#eJwFwTEOgzAMBdC7fFXKErEgBnyK7lWHACZECk6L7QEh7s57F5TNimTQBZZchEE41nkc-gERze3n9k62KWhNVfmO-DsfJwivbmrL2X3CniSnEEOp1dU0fBGxtNl3FgMB9wMPLiJP).)
### A specific URL where the issue occurs.
```yaml
https://www.pixiv.net/en/users/120961088
```
### Steps to Reproduce
1. Open JSONPath tool.
2. Enter [JSON Data from gist](https://gist.github.com/Stevoisiak/9cd04b8d584cb2a15d200027ea8c1cc4).
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
```text
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
```
0 条评论