Skip to content
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

Fix converter for uBO's []/{} in set-constant scriptlet #269

Merged
merged 1 commit into from
Dec 16, 2022
Merged

Fix converter for uBO's []/{} in set-constant scriptlet #269

merged 1 commit into from
Dec 16, 2022

Conversation

gorhill
Copy link
Contributor

@gorhill gorhill commented Dec 15, 2022

Related issue:

This fixes conversion of scriptlet filters such as:

mirrormedia.mg#%#//scriptlet("set-constant", "dataLayer", "emptyArr")

To:

mirrormedia.mg##+js(set-constant, dataLayer, [])

Whereas before the fix this would result in the following scriptlet:

mirrormedia.mg##+js(set-constant, dataLayer, emptyArr)

Which would be rejected by uBO.

Similarly for emptyObj => {}.

Related issue:
- uBlockOrigin/uBlock-issues#2411

This fixes conversion of scriptlet filters such as:

  mirrormedia.mg#%#//scriptlet("set-constant", "dataLayer", "emptyArr")

To:

  mirrormedia.mg##+js(set-constant, dataLayer, [])

Whereas before the fix this would result in the following scriptlet:

  mirrormedia.mg##+js(set-constant, dataLayer, emptyArr)

Which would be rejected by uBO.

Similarly for `emptyObj` => `{}`.
@slavaleleka slavaleleka self-requested a review December 15, 2022 17:26
@adguard adguard merged commit b81c79c into AdguardTeam:master Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants