ytc-filter icon indicating copy to clipboard operation
ytc-filter copied to clipboard

not displayed when logging in with a premium account

Open Rainbowrain-TW opened this issue 2 years ago • 0 comments

Describe the bug

As title

Solution

I solved this problem by editing two functions in 'contents.js'

set selector from ytd-video-owner-renderer ytd-channel-name .yt-simple-endpoint to ytd-video-owner-renderer ytd-channel-name a.yt-core-attributed-string__link

var getChannelId = function getChannelId() {
  if (document.location.origin === 'https://studio.youtube.com') {
    return 'Studio';
  } else if (isYoutubeIframe()) {
    return window.parent.top.document.querySelector('ytd-video-owner-renderer ytd-channel-name a.yt-core-attributed-string__link').href.split('/').pop();
  } else {
    // Context other than Youtube's chat
    return null;
  }
};

and

var getChannelName = function getChannelName() {
  if (document.location.origin === 'https://studio.youtube.com') {
    return 'Studio';
  } else if (isYoutubeIframe()) {
    return window.parent.top.document.querySelector('ytd-video-owner-renderer ytd-channel-name a.yt-core-attributed-string__link').text;
  } else {
    // Context other than Youtube
    return null;
  }
};

This extension is helpful. Thank you.

Rainbowrain-TW avatar Dec 10 '22 03:12 Rainbowrain-TW