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

Add a scriptlet to intercept atob call and prune its text output #3157

Closed
9 tasks done
Yuki2718 opened this issue Mar 4, 2024 · 13 comments
Closed
9 tasks done

Add a scriptlet to intercept atob call and prune its text output #3157

Yuki2718 opened this issue Mar 4, 2024 · 13 comments
Labels
enhancement New feature or request fixed issue has been addressed

Comments

@Yuki2718
Copy link

Yuki2718 commented Mar 4, 2024

Prerequisites

  • 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.
  • This is NOT a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

AdguardTeam/Scriptlets#410

A specific URL where the issue occurs.

https://www.youtube.com/watch?v=35kwlY_RR08

Steps to Reproduce

Not trivial if you don't have an account reached the 3-strikes warning count but see the link

Expected behavior

NA

Actual behavior

NA

uBO version

1.56.0

Browser name and version

Google Chrome 122.0.6261.95

Operating System and version

Windows 10

@uBlock-user uBlock-user added the enhancement New feature or request label Mar 4, 2024
@gorhill
Copy link
Member

gorhill commented Mar 4, 2024

A generic approach of what you are asking is trusted-replace-outbound-text.

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Apr 1, 2024

Looks like recently they are using the same method for their new type of ads so I think it's good to have trusted-replace-outbound-text in this dev cycle.

@Yuki2718
Copy link
Author

Yuki2718 commented Apr 1, 2024

Yes, now this issue should be given higher priority than before, as it is used for SSAP ads too.

gorhill added a commit to gorhill/uBlock that referenced this issue Apr 1, 2024
Related issue:
uBlockOrigin/uBlock-issues#3157

Paremeters:
- `pattern`: a string or regex to match in the outbound text. If
  not provided or empty, the scriptlet will only log the outbound
  text without modifying it.
- `replacement`: the replacement string for the matched part.
@troysjanda
Copy link

troysjanda commented Apr 1, 2024

what would an example filter look like?

@iam-py-test
Copy link
Contributor

iam-py-test commented Apr 1, 2024

As I understand it:

##+js(trusted-replace-outbound-text, [function to target], [string to replace/pattern], [replacement])

Example:

example.com##+js(trusted-replace-outbound-text, atob, foo, bar)

atob(btoa("foo Hello world")) returning "bar Hello world"
Thanks

@Yuki2718

This comment was marked as outdated.

@Yuki2718
Copy link
Author

Yuki2718 commented Apr 1, 2024

How to log this scriptlet?

@ryanbr
Copy link

ryanbr commented Apr 1, 2024

Maybe add an log option, so if its succesful or not in replacing a function.

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Apr 2, 2024

I haven't found how to log it when successful yet, but you can log the outbound text in general by

example.com##+js(trusted-replace-outbound-text, atob)

@gwarser Sorry, do you know how safe.logLevel works?

@gorhill
Copy link
Member

gorhill commented Apr 2, 2024

do you know safe.logLevel works?

It's the speaker in the logger.

@stephenhawk8054
Copy link
Member

Oh... This is the first time I hear about it. Don't know why I haven't wondered myself about what that button is 😄


Yeah, confirm I can see the outbound text now
image

@uBlock-user
Copy link
Contributor

trusted-replace-outbound-text

They can be used to address reddit's data collection and tracking I think.

@gorhill gorhill closed this as completed Apr 14, 2024
@gwarser gwarser added the fixed issue has been addressed label Apr 15, 2024
@Yuki2718
Copy link
Author

We now need an option or a new scriptlet to decode/encode text. See AdguardTeam/Scriptlets#410 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

8 participants