-
Notifications
You must be signed in to change notification settings - Fork 574
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
New YouTube UI fix for the latest version 3.0.0.11 #952
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should get some info on which browsers / devices this works on. Here are a few on which these changes make it work:
Windows 10:
- Chromium Version 116.0.5845.141 (Official Build, ungoogled-chromium) (64-bit)
- Brave Version 1.59.117 Chromium: 118.0.5993.70 (Official Build) (64-bit).
- Firefox Developer Edition 119.0b2 (64-bit)
Windows 11:
- Google Chrome Version 118.0.5993.71 (Official Build) (64-bit)
I get this error when I open a short video but dislike count still there no issue:
From:
Windows 11:
So I think with this error if I dislike a video, it will not count my dislike through API |
I'm getting it sometimes on both Windows 10 and Windows 11. Both on:
I think this should be fine since if you do: function getDislikeButton() {
console.log("getDislikeButton");
const dislikeButton =
getButtons().children[0].tagName ===
"YTD-SEGMENTED-LIKE-DISLIKE-BUTTON-RENDERER"
? getButtons().children[0].children[1] === undefined
? document.querySelector("#segmented-dislike-button")
: getButtons().children[0].children[1]
: getButtons().children[1];
console.log(dislikeButton);
return dislikeButton;
} You end up getting what seems like calls to get the buttons until they exist.
Think there is some underlying logic in state where we re-querySelect if we error or something or it might be some mutationobserver implementation that I haven't looked into. If someone has insight into this, let us know. To summarize: This should be fine 😅. EDIT: More importantly, when inspecting the service worker's network tab we can see the request succeeding even if we had the error in the console. API is still getting the info it needs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can confirm it's work in chrome 118.0.5993.70 macOS
Actually there is a mutationObserver I think and it causing issues To produce the error:
To stop the error:
mutationObserver code:
for some reason the MutationObserver doesn't initiate if you produce the error steps above, and the only way to initialize it is by refreshing the page while we are on shorts path |
Unless there are more issues than the errors in the console from before, I don't think it's a huge priority but something we should look at next. |
This change doesn't really make any sense, does it? I fixed it locally like this: const textNodeClone = (getLikeButton().querySelector("button > div[class*='cbox']") || (getLikeButton().querySelector('div > span[role="text"]') || document.querySelector('button > div.yt-spec-button-shape-next__button-text-content > span[role="text"]')).parentNode).cloneNode(true); Since the like button does not have any |
Fair point. It's interesting to note that just
|
This seems to have been fixed by other PRs, please reopen if experiencing issues with the latest extension version |
I changed this line of code in createDislikeTextContainer() function:
const textNodeClone = (getLikeButton().querySelector("button > div[class*='cbox']") || getLikeButton().querySelector('div > span[role="text"]').parentNode).cloneNode(true);
changed to this:
const textNodeClone = (getLikeButton() || getLikeButton().parentNode).cloneNode(true);
Selectors: ("button > div[class*='cbox']") and ('div > span[role="text"]') can't be found on the page