-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support AdGuard set-constant value aliases 'emptyArr' and 'emptyObj' #2411
Comments
The filter in original "AdGuard Tracking Protection" list is:
This means it's improperly converted to uBO's syntax. The conversion should be fixed in AdGuard's converter, it's already done for empty string (ref). |
fix by @gorhill uBlockOrigin/uBlock-issues#2411 * commit '993c7648279c7c6c7eb7ee8f3ef92724fe584651': add related issue link to changelog update changelog add few simple tests fix converter comments fix readme Fix converter for uBO's `[]`/`{}` in `set-constant` scriptlet
related: uBlockOrigin/uBlock-issues#2411 Squashed commit of the following: commit a77002f Author: Slava Leleka <v.leleka@adguard.com> Date: Fri Dec 16 21:55:31 2022 +0200 update changelog commit 786830f Author: Slava Leleka <v.leleka@adguard.com> Date: Fri Dec 16 21:54:48 2022 +0200 fix changelog style commit da136a6 Author: Slava Leleka <v.leleka@adguard.com> Date: Fri Dec 16 21:52:48 2022 +0200 update scriptlets to v1.7.14, tsurlfilter to v1.0.64 commit 5a4676b Author: Slava Leleka <v.leleka@adguard.com> Date: Fri Dec 16 21:51:42 2022 +0200 add few scrpitlets conversion tests
@gorhill This is the result of
References: PS: |
Prerequisites
I tried to reproduce the issue when...
Description
AdGuard scriptlets implement different literal value using 'emptyArr' and 'emptyObj' instead of '[]' and '{}' in uBO. Please consider implementing those aliases since uBO is the only out-of-the-box privacy filter featuring scriptlets (and the other being EasyPrivacy which does not manipulate Javascript).
References:
AdG set-constant
uBO set-constant
A specific URL where the issue occurs.
mirrormedia.mg
Steps to Reproduce
Rule
*##+js(set, window.test, emptyArr)
is not resolved.Rule
*##+js(set, window.test, emptyObj)
is not resolved.Expected behavior
Example AdG grammar:
mirrormedia.mg##+js(set-constant, dataLayer, emptyArr)
should work the same as uBO grammar:
mirrormedia.mg##+js(set-constant, dataLayer, [])
Actual behavior
Rule
mirrormedia.mg##+js(set-constant, dataLayer, emptyArr)
is not resolved; nothing happens in the logger.uBO version
1.45.2
Browser name and version
Firefox 102.0
Operating System and version
Windows 10
The text was updated successfully, but these errors were encountered: