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

YouTube homepage teleports up when loading new videos #25

Closed azalty closed 3 years ago

azalty commented 3 years ago

When this plugin is enabled and each time a whitelisted channel/video appears (loads) on the homepage while loading new videos (scrolling down), the page automatically teleports a row higher, making kind a jitter effect when scrolling down. This is really annoying for browsing. Closing the browser seems to fix this for some time, but this bug will always occur after some time (probably after watching a video?)

Simply reloading the page doesn't fix it. Reloading the page after disabling the plugin fixes it.

It also seems to reload every video thumbnail

x0a commented 3 years ago

Thanks for the report

I have a pretty good idea what's causing this. The first video on the homepage is actually an ad. Previously removing the element would suffice but it seems YouTube detects that the video was removed on scroll and inserts a new one, which is removed again by the extension.

The next update should fix this, maybe by tonight

x0a commented 3 years ago

This should be fixed in v0.13.4 which is now live on Mozilla Addons (Chrome Web Store typically takes a few days to approve the update). If you use Firefox, try updating your addons and see if this resolved the issue.

Thanks

azalty commented 3 years ago

Seems fixed! Thanks!

azalty commented 3 years ago

@x0a this seems to happen again from time to time, should I open this issue or should I create a new one?

x0a commented 3 years ago

Thanks again for keeping an eye on this!

I've been testing for a few days and I am unable to preproduce on Chrome 94.0.4606.81 or Firefox 93.0. There are two possibilities:

  1. A region-specific change.
  2. A another extension being overzealous.

The element that YouTube adds at the beginning of the page must be hidden or removed, but only removed if the child can be removed. The ad at the beginning is an element named ytd-display-ad-renderer, inside of the normal ytd-rich-item-renderer which all the other normal videos are under. If the entire ytd-rich-item-renderer is removed, then YouTube will try to add a replacement after a few seconds. So it must be hidden instead (or hidden from the beginning). Some extensions opt to remove the entire element instead of hiding it, which results in YouTube adding it again, which results in the page scrolling changing position. I wrote special code to try and mitigate this. uBO uses a very similar (non-standard) rule that looks like youtube.com##ytd-display-ad-renderer:upward(ytd-rich-item-renderer), and they add a an extra CSS rule that hides this element entirely. So it could be an extension looking to remove this element entirely that causes the issue.

Do you have any extra extensions installed that contain adblocking other than this extension and ublock-origin.,

Thanks

azalty commented 3 years ago

I only use SponsorBlock on top of these

azalty commented 3 years ago

This seems to happen even when I disable YT Channel Whitelist, so it is most likely not linked to it. Probably uBlock origin's fault?

x0a commented 3 years ago

Hey thanks for the update!

I had been testing for over a week and arrived at the same conclusion. Since uBO-YT has built-in adblocking, it's probably best to whitelist all of YouTube and allow uBO-YT to handle that. If you encounter adblocking issues, let me know.

I appreciate your time and effort, don't hesitate to report other issues!

Thanks again x0a