Skip to content

matchRequestProps fails to match URL objects passed to fetch #577

Description

@Stevoisiak

Issue

I have a json-edit-fetch-response rule that hides AI auto-suggestions for the search bar on https://www.yahoo.com/?guccounter=1.

yahoo.com#%#//scriptlet('json-prune-fetch-response', '$.r[?@.m==89]')

When adding a propsToMatch parameter that matches the source URL, the filter stops working.

yahoo.com#%#//scriptlet('json-prune-fetch-response', '$.r[?@.m==89]', 'propsToMatch', '/sugg/gossip/gossip-us-fastbreak')

Chrome's devtools show that the propsToMatch value should match the request URL.

Image Image

When using the uBlock Origin (added in Scriptlets v2.5.0) syntax and scriptlet name json-edit-fetch-response, the version without propsToMatch works in both AdGuard and uBO, but the version with propsToMatch only works in uBO.

! Works in both AdGuard and uBO
yahoo.com##+js(json-edit-fetch-response, $.r[?@.m==89])
! Only works in uBO
yahoo.com##+js(json-edit-fetch-response, $.r[?@.m==89], propsToMatch, /sugg/gossip/gossip-us-fastbreak)

Steps to reproduce

  1. Add user rule for yahoo.com#%#//scriptlet('json-prune-fetch-response', '$.r[?@.m==89]', 'propsToMatch')
  2. Go to https://www.yahoo.com/?guccounter=1 with traffic originating from the United States.
  3. Click on the search bar.

Expected result

The AI suggestion at the top of the search autocomplete suggestions is hidden. propsToMatch does not prevent the filter from working, since the source URL matches.

Actual result

The AI suggestion is not hidden.

Image

System info

  • OS: Windows 11
  • Browser: Google Chrome Version 151.0.7922.173 (Official Build) (64-bit)
  • Extension: AdGuard Browser extension Version 5.5.0.5

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions