yakisova41 / return-youtube-comment-username

This is to change the handle in the YouTube comments section to a username
https://rycu.yakisova.com/
MIT License
51 stars 2 forks source link

Not working in Firefox when logged in to YouTube #43

Closed R3G3N3R4T0R closed 1 year ago

R3G3N3R4T0R commented 1 year ago

The script does not work when logged in and using Firefox. It works fine in Chromium-based browsers. The culprit is querySelector from the function rewriteCommentNameFromContinuationItems

const commentRenderer = commentElem?.querySelector(
  "ytd-comment-renderer"
);

Debugger Logged Out image Debugger Logged In image HTML Logged In image

These are from the same link, one successfully selected ytd-comment-renderer from ytd-comment-thread-renderer and another failed to do so. And ytd-comment-renderer does exist in the logged in version.

CY Fung's alternative implementation also has the same issue. I haven't debugged his but also no request for username when logged in so likely the same problem.

Versions Tested

yakisova41 commented 1 year ago

Am I correct that ytd-comment-renderer is null when I am logged into my Google account?🤨 It is working fine in my Firefox, so I would like to know the detailed procedure to reproduce it.

R3G3N3R4T0R commented 1 year ago

No, ytd-comment-renderer is not null when logged in if the tag is what you are referring to. it is just that the commentElem.querySelector("ytd-comment-renderer") method returned null when logged in. The only difference between logged in and logged out is the HTML for the like/dislike buttons, reply box, and the more/less reply buttons.

It appears that both my main and alt are affected so if anything differs between our systems it could be a regional issue. YouTube did not use handles when logged in, only when logged out until a few days ago for me.

Step to reproduce it is as such:

  1. Create a new profile in Firefox, load in TamperMonkey/ViolentMonkey and your script from GreasyFork.
  2. open www.youtube.com and pick a video.
  3. scroll down and YouTube comments should have usernames
  4. Log in to YouTube, and return to the same video
  5. scroll down and YouTube comments should have handles.
yakisova41 commented 1 year ago

We have identified the cause and have released a fixed version v0.3.5. Please update it.

R3G3N3R4T0R commented 1 year ago

Can confirm it is fixed. Thanks for the quick response