Open ryanbr opened 1 month ago
From TR, it’s working well.
Brave exprimental Adblock Rules
Just in case, some extension/userscript may cause the Twitch Adblock method to breakage.
For example, FrankerFaceZ Addons:
I noticed that this option caused the issue when I used AdGuard Extra. This Addon setting was causing the midrolls infinite buffering time to time. When I disabled this setting, no buffering problem since then. I won't be able to check that for Brave, because it's diffucult to trigger midrolls. So just to inform. 👍
Likely conflicting with AdGuard Extra's vaft script. Vaft will switch to a lower quality stream with no ads during midrolls, as the normal stream will have the full screen ad, and switch back once midroll is over. Potentially this addon setting is breaking this core function and causing it to buffer. Would have to look at the code to be sure, but it not happening with the setting disable certainly suggests so. Could be something to note in this repo's README down the line if more people come across the same issue.
Could be something to note in this repo's README down the line if more people come across the same issue.
Looks like there is a similar issue related on this PR, see: https://github.com/pixeltris/TwitchAdSolutions/pull/199
I was manually solving the infinite buffering issue with pause/play.
@pixeltris is there a downside to https://github.com/pixeltris/TwitchAdSolutions/pull/199 ?
@kodiakhub I don't think we can avoid issues with 3rd party twitch scripts/extensions. Similar to the issues people see with Youtube ads, list authors don't recommend using privacy/YT/other adblock extensions which may trigger false positives.
@kodiakhub I don't think we can avoid issues with 3rd party twitch scripts/extensions. Similar to the issues people see with Youtube ads, list authors don't recommend using privacy/YT/other adblock extensions which may trigger false positives.
It's understandable, at least might think consider adding a Tooltips about 3rd party extensions and userscripts etc at brave://settings/shields/filters. Similar to "Note that enabling too many filters will degrade browsing speeds."
It may be useful like for end users.
We'll take it on board, though users probably won't notice it unless its pointed out (via a support agent)
@pixeltris Getting some reports; ( a few hundred)
video player not loading. applies to every stream i visit
Twitch broadcasts are not opening, I tried to delete cookies again.
twitch live videos/vods doesn't work with brave Shields on for some reason
twitch won't play (took forever to load) the video without disabling shield
Trying to reach to one user, in case its an extension compatibility issue.
video player not loading. applies to every stream i visit Twitch broadcasts are not opening, I tried to delete cookies again. twitch live videos/vods doesn't work with brave Shields on for some reason twitch won't play (took forever to load) the video without disabling shield
I'm wondering something, do these report complaints go through a process of prerequisites etc. (i.e. related to the 3rd party issue)? 🤔
https://old.reddit.com/r/brave_browser/comments/1fjqmd8/brave_shield_no_longer_working_on_twitch/ https://old.reddit.com/r/brave_browser/comments/1fjrhxl/brave_twitch_adblock_rules_list_has_started_to/
Asking about extensions, my hunch
In my opinion, processes like this only increase the workload and waste time. Due to XY problem. To put it simply, the uBO reddit has come a long way in this regard. (Guide, Rules etc.) I think similar system is needed for Brave like AdGuard and uBO prerequisite systems. I'm just saying. 👍
@ryanbr You can see the situation by looking at the Brave reddit comments, right? 🙂
No playback / infinite loading wheel means conflicting solutions (Worker hooked multiple times). There's a list of chromium extensions here which all use an older copy of vaft
https://github.com/pixeltris/TwitchAdSolutions/blob/master/full-list.md#extensions-to-avoid. Similarly @arthurbolsoni's Purple Adblock. Someone could also have an old vaft
/ video-swap-new
permalink hooked up to Brave which would conflict. There probably are more.
@pixeltris is there a downside to https://github.com/pixeltris/TwitchAdSolutions/pull/199 ?
This PR is specifically for improving freezing issues which is a separate thing from the no playback / infinite loading wheel. The Worker hook check could probably be improved such as preventing overwriting (i.e. the reverse of #169), though this may cause other problems.
In terms of #199 as a way to fix freezing; I haven't been able to test much. On chromium I didn't experience the freezing often and midrolls need to be tested as that's where most of freezing issues occur on chromium.
can’t use the redeem function or whispers or even subscribe to people. I moderate a community as well and I can’t do any of the mod actions
I'm not too sure about this one as I haven't tested anything with an account in a long time. There's a similar thing with clip creation #121
Is there any way we can detect in the JS that there's an older copy of vaft
being used, and in that case, not inject or try to register the Worker?
The new script already has such a check. It works if all scripts have the check or if the old script loads before the new script. But it doesn't help when the old script loads after the new script
Object.defineProperty
with writable:false
as a way of assigning the Worker seems to work when the old script loads after the new script. But it feels like a bad fix. If another script comes along which also uses Object.defineProperty
as assignment and doesn't check the integrity of the Worker you'll run into the same problems.
If another script comes along which also uses Object.defineProperty as assignment and doesn't check the integrity of the Worker you'll run into the same problems.
I think at some point we'll just have to tell users that they shouldn't be installing janky extensions. It's the first roll out that's the tricky thing.
If a user installs an extension that immediately starts causing issues, then they know that it's probably the new extension that's at fault. Currently however, given that we're deploying this new script out, it looks like TwitchAdSolutions/vaft/vaft.user.js is breaking things, not the older and worse scripts.
Just to outline we reverted the twitch scriptlet due to the breakages from other extensions, When we test this I had no issues it did a good job at block the adverts.
But I wasn't using any 3rd party twitch extensions either. Having the script exit gracefully if detecting an extension or other methods would be ideal tbh. From what was discussed from the community these 2 extensions came up:
As mentioned above using Object.defineProperty
/ writable:false
to assign the Worker is the only way I can see to prevent the double Worker hook with the current versions of the extensions. I can't say what side effects that may have, but it does seem to work from my limited testing.
Alternatively you'd need to do something on the Brave side of things to check for installed extensions as the script doesn't have access to this kind of information.
https://github.com/pixeltris/TwitchAdSolutions/commit/69f098d882eba30a6466ad99eadf487c0aa68139 should fix it. This checks if other scripts / extensions have modified the Worker after the script does. With the current versions of Stream Cleaner
/ Purple Ads Blocker
it'll always use their extension rather than the script.
Asking if the user has any extensions installed; Not sure if you've heard of this issue.
https://x.com/CryptoWaDummy/status/1839879698509074786
I was using the Content filter "Brave Twitch Adblock rules" while I was in a streamers chat it would say it was in emote only. In reality it was not. When I disabled the filter it worked as intended
https://github.com/brave/brave-browser/issues/22370#issuecomment-2464279890
Some initial testing with various extensions (old and new)
I see with the recent change https://github.com/pixeltris/TwitchAdSolutions/commit/722f5b96241ef1d92998b87f941690e47e475379 there's a regression with the script + TTV LOL PRO which results in neither being applied. @younesaassila
Stream Cleaner
does work from my testing, both alone and with the experimental Brave filter.
Better Twitch Adblock
/ Adblock for Twitch
are broken as you mention as they are outdated / lack this fix https://github.com/pixeltris/TwitchAdSolutions/commit/044d1fb3bb88a19ab718603069354d43eeba7015. But it's still triggering the Brave script's check for another active solution so ads get through.
Not ideal. I'll have a think about the conflicts with broken solutions.
Its better than breaking the site to be fair (the endless black screen looping issues previously), but would be nice if interactions between TwitchAdSolutions and some extensions could be tweaked/improved.
Thanks for updates and contributions. Much appreciated
Try out this version https://gist.github.com/pixeltris/8c40313fcc8da2687381ba7b6c10adff (diff: https://gist.github.com/pixeltris/8c40313fcc8da2687381ba7b6c10adff/revisions)
It should always block ads and there shouldn't be conflicts with the extensions you tested.
It has the following properties:
Worker
instancewindow.Worker
with Object.defineProperty
/ writable:false
to prevent hooking over our Worker
hookWorker
hook we detect it and pull out the original url the Worker
was initialized with. If it fails to find the original url it does an eval
to prevent the black screen / infinite loading screenwindow
scope which can be bumped when conflicts arise with extensions which copy/paste the script and leave it in a broken / unmaintained stateProblems:
Worker
may cause problems for extensions which depend on hooking Worker
onmessage
is being overridden by other extensions when they are applied after the script. TODO: Switch to using addEventListener
, modify all currently used message names to avoid conflicts with old solutions, and add some validation that the script's hook is activeNice. can you update the *-ublock-origin.js ? How safe is it to roll out for testing in Brave?
Just a heads up,
In the process of rolling out twitch adblocking https://github.com/brave/brave-core/pull/25546
Using https://github.com/brave/adblock-lists/blob/master/brave-lists/brave-twitch.txt (Scriplet: https://github.com/brave/adblock-resources/blob/master/resources/vaft-ublock-origin.js)
I haven't seen any reports of broken issues other than https://old.reddit.com/r/brave_browser/comments/1f7ny6s/twitchtv_doesnt_work_anymore/ But I don't believe its an issue with the scriplet here.
Want to test it to be sure it works well? Enable
Brave experimental Adblock Rules
inbrave://settings/shields/filters
Does it work well?