Closed wthueb closed 2 years ago
Unfortunately I haven't been able to test this, as YouTube seems to like to sporadically give me the new like buttons and I didn't save the page when I last saw them, but if I'm remembering correctly these selectors should be right. I'll update this to confirm this works if YouTube decides I should see the new buttons anytime soon.
If you can send me a compiled beta (for chrome) I can test it since I seem to be getting the new buttons all the time now
Your selector is a bit too specific, their is multiple youtube version co-existing at the same time. Some users are selected to test the new youtube version in their country and it differ for different countries. Ex: US may have latest youtube, while spain has only few users doing beta while none in Australia use the newer youtube.
I suggest you those selectors: (used on Firefox version)
if mobile location.hostname == "m.youtube.com"
:
".slim-video-action-bar-actions"
if old (document.getElementById("menu-container")?.offsetParent === null)
:
"ytd-menu-renderer.ytd-watch-metadata > div"
if new (document.getElementById("menu-container")?.offsetParent !== null)
:
document
.getElementById("menu-container")
?.querySelector("#top-level-buttons-computed");
@Taknok I don't think that mobile support has historically been a consideration for this project, and it seems like @austencm phased out non-material YouTube a long time ago with v2.0.0. The current selector(s) do use "#menu-container #top-level-buttons-computed"
.
YouTube has decided to show me the new buttons and I can confirm that these new selectors are working.
True for mobile, but I put an extended answer to give all keys to the owner. So he can select what he wants in the tool box.
There is subversion in youtube material, where tags, id, class, elements, SVG path change etc etc. On Firefox I had to release 2 versions of the addon in a row, and it goes like that:
No issue report for now
So yes those new selectors are working for you, but maybe not for half of the others users, which is why I advise to use both testing case and adapted selectors. This is how I handled it in Firefox and I hope it can save time and release to austencm.
If you look at the commit, I added the new selector while keeping the old (current, non-beta) one. This change doesn't remove functionality for anyone, it simply adds functionality for those who are shown the beta version of the UI.
Closing this because I haven't seen the new buttons in a long time and never got to test it.
Addresses #95.