`$replace` rules with comma work incorrectly
Please answer the following questions for yourself before submitting an issue
- [X] Filters were updated before reproducing an issue
- [X] I checked the knowledge base and found no answer
- [X] I checked to make sure that this issue has not already been filed
AdGuard Extension version
4.4.30
Browser version
Firefox
OS version
Windows 11
Ad Blocking
AdGuard Base filter
Privacy
No response
Social
No response
Annoyances
No response
Security
No response
Other
No response
Language-specific
No response
What Tracking protection options do you have enabled?
No response
Issue Details
Steps to reproduce:
- Add this rule:
||example.org^$replace=/Example Domain/Example\, Domain/
- Go to - https://example.org/
Expected Behavior
Content should be modified to:
Example, Domain
Actual Behavior
Content is modified to:
Example\, Domain
Screenshots
Screenshot extension Firefox
Additional Information
According to documentation, a comma , should be escaped in $replace rules and if it's not escaped then rule is not applied.
The problem is that \ is added to the content but should not be and in the app it is not.
Screenshot app for Windows
https://adguard.com/kb/general/ad-filtering/create-own-filters/#replace-modifier
In the
$replacevalue, two characters must be escaped: comma,and dollar sign$. Use backslash\for it. For example, an escaped comma looks like this:\,.
$replacerules with comma work incorrectly
...or don't work completely. Example:
Not work:
||example.org^$replace=/Example \w{4,6}/Fix Me!/
||example.org^$replace=/Example \w{4\,6}/Fix Me!/
But works:
||example.org^$replace=/Example \w{6}/Fix Me!/