Skip to content
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

Undo New Sidebar not working in some instances #2327

Open
pedro-h-marchesi opened this issue Jun 3, 2024 · 4 comments
Open

Undo New Sidebar not working in some instances #2327

pedro-h-marchesi opened this issue Jun 3, 2024 · 4 comments
Labels
Bug Bug or required update after YouTube changes good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥

Comments

@pedro-h-marchesi
Copy link

First, I wanted to greatly thank everyone for allowing the new (and HORRENDOUS) sidebar to be removed. I noticed this intermittent behaviour some days ago and felt it was best to report it.

Bug Report:

  • Description: When opening a video, the new sidebar is sometimes maintained even if "undo_the_new_sidebar" is set to true. I need to refresh the page so it is actually undone.
  • Steps to reproduce this: Feature "undo_the_new_sidebar" must be enabled. See video below with 7 scenarios tested (Issue found in scenarios 1, 2, 3, 6 and 7. Issue not found in scenarios 4 and 5). Apologies for bad quality (had to reduce it so it could be attached).
Undo.NEW.Sidebar.not.working.smaller.mp4

I tried resetting all features and only enabled "undo_the_new_sidebar" and the issue was still found for most scenarios.
After doing this, I noticed that Scenario 7 is fixed when "hide_playlist" is set from true to false. This also fixed Scenario 6 in some cases, but it was still seen in others (couldn't find any reasoning to when it happens, but maybe it's related to the current page settings?).
Also, kindly disconsider the "VIDEO PAUSES" warnings for the last two scenarios. I later found that enabling "playlist_autoplay" solves this.

  • Since when?: I believe this issue has been happening since the "Undo New sidebar" feature has been implemented, but I can't verify that since the feature was already available when I started using the tool.
  • Browser: Google Chrome
  • Does the bug not happen when you log out of YouTube? The issue is also found when I log out of YouTube.

More:

  • Expected /preferred behavior: New sidebar being disabled the first time a video is opened, without having to refresh the page.
  • ImprovedTube Version: 4.941
  • Tested alone without other YouTube extensions or in incognito mode?
    Issue found even with other YouTube-related extensions disabled (Video Speed Controller, YCS, YouTube Captions Search). Issue also found when ImprovedTube is allowed in Incognito.
  • My Settings: {"add_scroll_to_top":true,"always_show_progress_bar":false,"ambient_lighting":false,"auto_generate":true,"below_player_loop":false,"day_of_week":true,"description":"expanded","hide_clip_button":"hidden","hide_download_button":"hidden","hide_playlist":true,"hide_shorts_remixing":true,"hide_thanks_button":"hidden","hide_voice_search_button":true,"lastDarkTheme":"dark","livechat":"collapsed","mini_player":false,"no_page_margin":true,"player_autoplay_button":true,"player_hide_cards":true,"player_loudness_normalization":false,"player_miniplayer_button":false,"player_next_button":true,"player_previous_button":true,"player_remote_button":true,"player_screenshot_button":true,"player_size":"custom","player_view_button":true,"playlist_autoplay":false,"playlist_up_next_autoplay":false,"remove_home_page_shorts":true,"remove_shorts_reel_search_results":true,"shortcut_custom_mini_player":{"keys":{"73":{"key":"i"}}},"theme":"dark","thumbnails_right":true,"undo_the_new_sidebar":true,"up_next_autoplay":false}
  • OS: Windows 11 Pro

Thank you in advance!

@pedro-h-marchesi pedro-h-marchesi added Bug Bug or required update after YouTube changes good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ labels Jun 3, 2024
ImprovedTube added a commit that referenced this issue Jun 3, 2024
@ImprovedTube
Copy link
Member

hi! and thanks @pedro-h-marchesi
sorry the feature only ran at our improvedtube.init() yet, which is called after our settings are loaded in the tab
https://github.com/search?q=repo%3Acode-charity%2Fyoutube+undo+language%3AJavaScript&type=code&l=JavaScript

however there are more other events and timing we can use such as:
yt-navigate-finish yt-page-data-updated
load
so i just added it at yt-navigate-finish 8ff4487

you can test: https://github.com/code-charity/youtube/archive/refs/heads/master.zip
(unzip and load at chrome://extensions "dev mode")

@pedro-h-marchesi
Copy link
Author

pedro-h-marchesi commented Jun 4, 2024

Hey, there! Thank you again for the quick reply! ^^
I've never tested a fix before, but I tried following your instructions (unzipping it and dragging it into dev mode chrome://extensions). I tested the issue but could still see it in the scenarios reported. Then I saw that Chrome had reported some errors in the following line: "if(this.storage.undo_the_new_sidebar === true){this.undoTheNewSidebar();}".
It also showed this: js&css/web-accessible/init.js:125
Not sure if I did something wrong or if it's indeed some sort of bug in the code, but felt it was worth sharing here :)

@pedro-h-marchesi
Copy link
Author

pedro-h-marchesi commented Jun 11, 2024

Hey there, @ImprovedTube!
Following up on this to report something I've noticed: Last week (I want to say it was on the 4th or the 5th) I noticed that my ImprovedTube had updated to 4.941 and the issue reported here was gone. I couldn't reproduce it anymore in any of the scenarios shared, and the thumbnails for related videos even looked much better too for some reason.
However, a couple of days ago (the 8th/9th I think) I noticed that for some reason the old behaviour came back and the problematic scenarios reported were found again. Today it upgraded to 4.944 but the issue is still present.
Since I couldn't find info on 4.941 or 4.944, could you kindly confirm to me if the issue is indeed still present or if I might have missed something? :)

PS: Unfortunately I couldn't take screenshots of the feature more desirable performance between the 4th and the 8th, so that's why I have nothing to attach here D:

@ImprovedTube
Copy link
Member

ImprovedTube commented Jul 12, 2024

hi! @pedro-h-marchesi
Thanks! it already works with a simple uBO rule.
For us just the change from June 3 happened yet.
(Doing that better can be on top of our to-do-list though.)

about this code btw: comparison: btw: #2251 and:

www.youtube.com##+js(set, yt.config_.EXPERIMENT_FLAGS.kevlar_watch_grid, false)
www.youtube.com##+js(set, yt.config_.EXPERIMENT_FLAGS.small_avatars_for_comments, false)
www.youtube.com##+js(set, yt.config_.EXPERIMENT_FLAGS.small_avatars_for_comments_ep, false)

thanks to @PoorChameleon #2038 (comment)


uBO doesnt crowdsource unfortunately, so:

the way uBO 'set' works is they put a Proxy over object prototypes https://github.com/gorhill/uBlock/blob/c154aaa69c6a2a4009d43923f1097c6298062b82/assets/resources/scriptlets.js#L556-L586 they even hide proxy presence so YT cant detect it (afaik YT doesnt try, but plenty of shady websites try to detect adblock/overrides) https://github.com/gorhill/uBlock/blob/c154aaa69c6a2a4009d43923f1097c6298062b82/assets/resources/scriptlets.js#L578-L580

This way no matter what inside real yt.config_.EXPERIMENT_FLAGS.kevlar_watch_grid any reader will always receive overridden value. We can definitely implement this, much saner, safer and more reliable than blindly writing to yt.config_.EXPERIMENT_FLAGS.kevlar_watch_grid hoping 1 its there 2 it wasnt read by YT engine yet

( by #2430 (comment) @raszpl )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug or required update after YouTube changes good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥
Projects
None yet
Development

No branches or pull requests

2 participants