-
Notifications
You must be signed in to change notification settings - Fork 30
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 new scriptlet — 'trusted-replace-outbound-text' #410
Comments
Now yt no longer uses
The first rule targets |
Squashed commit of the following: commit e7a0a2d Merge: a6f85a7 45a42cc Author: Adam Wróblewski <[email protected]> Date: Mon May 20 17:28:17 2024 +0200 Merge branch 'master' into feature/AG-30879 commit a6f85a7 Author: Adam Wróblewski <[email protected]> Date: Mon May 20 18:26:45 2024 +0300 AG-30879 Add ability to decode text in trusted-replace-outbound-text scriptlet Squashed commit of the following: commit fc7fcdc Author: Adam Wróblewski <[email protected]> Date: Tue May 14 11:51:48 2024 +0200 Rename to isValidBase64 commit e87edc4 Author: Adam Wróblewski <[email protected]> Date: Tue May 7 10:53:14 2024 +0200 Add logging for invalid base64 encoded strings commit 788f70b Author: Adam Wróblewski <[email protected]> Date: Mon May 6 17:54:10 2024 +0200 Add variable for logging decoded content Improve checkIfValidBase64 and add more tests commit f0f931e Author: Adam Wróblewski <[email protected]> Date: Fri May 3 17:08:17 2024 +0200 trusted-replace-outbound-text - add ability to decode base64 text content commit ff3e186 Author: Adam Wróblewski <[email protected]> Date: Fri Apr 26 11:03:30 2024 +0200 Update decription commit 0693ec6 Author: Adam Wróblewski <[email protected]> Date: Fri Apr 26 10:25:39 2024 +0200 Update description commit 76c8016 Author: Adam Wróblewski <[email protected]> Date: Fri Apr 26 10:00:07 2024 +0200 Log information that content is not a string commit c88ce94 Author: Adam Wróblewski <[email protected]> Date: Fri Apr 26 09:34:46 2024 +0200 Fix typo in function name commit 7ebb300 Author: Adam Wróblewski <[email protected]> Date: Thu Apr 25 12:18:59 2024 +0200 Log information about not modified content Add a test commit 48545bf Author: Adam Wróblewski <[email protected]> Date: Tue Apr 23 12:48:51 2024 +0200 Set default parameters Update test commit 2fcc905 Author: Adam Wróblewski <[email protected]> Date: Mon Apr 22 20:06:00 2024 +0200 Add trusted-replace-outbound-text scriptlet
Add a new scriptlet to intercept atob() call and prune its text output
Background: YT checks if anti-adblock warning (
auxiliaryUi.messageRenderers.bkaEnforcementMessageViewModel
) is removed by blocker by checkingplayerResponse.responseContext.mainAppWebResponseContext.trackingParam
which includes encoded info about the warning if it is sent. If we remove this encoded info together with the warning, we can safely remove the warning. This is currently done with$replace
rules removing parts oftrackingParam
but this approach is risky. The encoded info is finally decoded withatob
, and if we prune the info from the output ofatob
, we can safely remove the info. If you want to check by yourself, search for282054944_a
in/desktop_polymer.vflset
script in the debugger and put a break point before this, and follow the processing step by step. Here's the moment decoding was done when anti-adb is not sent. If sent, the output will be longer and include\n|\nGauxiliaryUi.messageRenderers.bkaEnforcementMessageViewModel.displayType\x121ENFORCEMENT_MESSAGE_VIEW_MODEL_DISPLAY_TYPE_POPUP\nM\nEauxiliaryUi.messageRenderers.bkaEnforcementMessageViewModel.isVisible\x12\x04true
.Screenshot 1
Actual rules working on Chrome as of writing:
Screenshot 2
The first line is what should be the new scriptlet. The next line overwrites
auxiliaryUi.messageRenderers.bkaEnforcementMessageViewModel
on Chromium at the first load of yt video. The third and forth rules disable the current rules doing the same on rawtrackingParam
, as we want to see the test rule works by itself. The last rule is to intentionally trigger the warning if the pruning failed.May possibly be more generic scriptlet like
trusted-prune-text-output
with target function as an argument (in this caseatob
), 0-based position of tareget argument in the function, condition for the pruning to happen (e.g. input/output includes specified string or regex), and stack trace.The text was updated successfully, but these errors were encountered: