x0a / uBO-YouTube

Easier way to exempt your favorite YouTube channels from adblocking.
GNU General Public License v3.0
124 stars 8 forks source link

Tabs getting muted when there is no ad #12

Closed MechanoRealist closed 4 years ago

MechanoRealist commented 4 years ago

Recently YouTube has been pushing out a new ad system that is wrecking havoc on adblockers like uBlock Origin. Errors when loading tabs from session, ads only getting half blocked showing overlays and occasionally a full ad playing despite uBlock being active.

This is where your extension breaks and gets confused about when and where there is an ad. The tab gets muted for some reason and then fails to unmute while continuing to play the video.

x0a commented 4 years ago

Thanks for the report and for providing the context.

When ads are detected, you should see the uBO icon inside the video player where you click to decide ad options. Does that icon remain after the ad is gone?

For the record, that change hasn't been pushed on my end so I can't reproduce at the time but I'll be trying some methods to force that update on my end so I can debug further.

In the meantime, I'll push an update with more methods to detect if an ad is playing, hopefully tonight or tomorrow (if not, certainly this week).

x0a commented 4 years ago

While I have not been able to reproduce the issue, I think I have a pretty good idea about what might be going on.

YT-uBO has a 'Skip playback errors' option which is enabled by default, which tries to skip to the video whenever a failed ad causes a playback error (example).

It uses the same attemptSkip() function as the 'Force Skip' button. https://github.com/x0a/uBO-YouTube/blob/78c4a1ca34e48fb94f75249f38f3f779d56348dd/src/inject.ts#L837-L848 Which mutes the tab to prevent audio from leaking, in case we need to speed playback to skip an ad.

If the tab is not being unmuted after the video resumes playing, we can assume that YouTube is not removing the .ad-showing class from the video player for some reason.

A quick workaround would be to not mute the tab during automatic ad skipping

x0a commented 4 years ago

Made some changes in https://github.com/x0a/uBO-YouTube/commit/7a92d65ec16eb3b5330fa2e664fba1343fa1fda4 and pushed an update for both Chrome WebStore & Mozilla Addons.

Chrome might take an extra week to approve the update but it should be available immediately for Firefox. See if you can update your extensions (the new version is 0.10.2), and let me know if the issue is still occurring.

MechanoRealist commented 4 years ago

Hey x0a I believe that totally fixed it. It even fixed the error screens caused by blocking the ad. Yeah you heard that right. In the new system, with only uBO running, an error will cover the video for the 5 seconds it normally takes to skip the ad. And a refresh of the page will reload the page sometimes with an ad and sometimes not. With your add-on active it skips immediately to the video. 😁

x0a commented 4 years ago

Awesome, happy to hear everything is working as it should. I added this feature specifically because I was worried people would blame our extension for the playback errors, but it seems we were (partially) to blame this time 😅

Feel free to re-open this issue if you see it come back.