-
Notifications
You must be signed in to change notification settings - Fork 23
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 trusted_types.js #194
Add trusted_types.js #194
Conversation
You're missing the resources.json etc changes |
This is just the scriptlet. I'm merging it in. We will review actually adding it via the filter rule. |
The scriptlet is incomplete and pretty much useless. It needs the functions from uBlock to work: run-at.fn function which has the safe-self.fn dependency. And not just that, it needs to be executed, so the way Brave does it with uBlock is by adding the
Of course since there are no arguments this would be the enough:
I don't even get why this scriptlet is being considered, since Youtube doesn't have any CSP rule for the trusted types anyway, maybe it is a preventative thing, but you can easily run Testing Youtube rules, they don't even give the error if the CSP directive was is in place, because it is not using anything that needs trusted types like eval or innerHTML or setInterval or Timeout or anything like that which is explained in https://web.dev/articles/trusted-types So, yeah, pretty confusing. If anything, when necessary, I guess Gorhill will eventually add it to their scriptlets as a function and then be added to whatever scriptlet needs to be added, not an independent scriptlet that is changing the default, but one a function that will allow just the JS code in the scriptlet to trust it. just as explained here https://web.dev/articles/trusted-types#trusted-type-policy and something like this: which can be tested pretty easily by using: and then:
which will not allow One of the most confusing parts is how the scriptlet is called trusted_types in the resources file but the rule in experimental lists (which will do nothing anyway) https://github.com/brave/adblock-lists/blob/21303479a7ea7cf265d5183f1759c846cca5288f/brave-lists/experimental.txt#L17 needs set-trusted-types... because that is only compatible with how uBlock reads the file to call it with the adblock, but in Brave the name unless alias is the one uses. So Have a nice day. |
Thanks for the suggestion. @TEMP-ad Trusted types being used on YT : https://groups.google.com/a/chromium.org/g/chromium-extensions/c/zMPYKu5wtZI/m/0gDa-UE_CgAJ?pli=1 |
Related discussion: brave/adblock-resources#194
https://github.com/stephenhawk8054/uBO-Scriptlets#set-trusted-types
for YT Ads.
www.youtube.com##+js(set-trusted-types)