return-youtube-dislike icon indicating copy to clipboard operation
return-youtube-dislike copied to clipboard

(Feature Request): Use real YouTube HTML

Open aubymori opened this issue 2 years ago • 1 comments

Extension or Userscript?

Both

Request or suggest a new feature!

I would implement this myself, but I can't get the code to compile or work. but, you should use YouTube's actual sentiment bar HTML instead of your recreation.

Ways to implement this!

Fix the code up to use this HTML as a template:

<ytd-sentiment-bar-renderer id="sentiment" class="style-scope ytd-video-primary-info-renderer" style="width: 129px;"><!--css-build:shady--><div id="container" class="style-scope ytd-sentiment-bar-renderer">
  <div id="like-bar" class="style-scope ytd-sentiment-bar-renderer" style="width: 98.4124%;"></div>
</div>
<tp-yt-paper-tooltip position="top" class="style-scope ytd-sentiment-bar-renderer" role="tooltip" tabindex="-1" style="left: 14.95px; top: -64px;"><!--css-build:shady--><div id="tooltip" class="style-scope tp-yt-paper-tooltip hidden">
  46,553 / 751
</div>
</tp-yt-paper-tooltip>
</ytd-sentiment-bar-renderer>

Note that you'll need to accomodate for the ytd-sentiment-bar-renderer that Google lazily left in but hid,

Can you work on this?

  • [ ] Yes
  • [X] No

aubymori avatar Feb 27 '22 05:02 aubymori

x = document.querySelector('ytd-sentiment-bar-renderer#sentiment div#container')
x.style.backgroundColor = 'red'
y = x.querySelector('div#like-bar')
y.style.width = '66%'
y.style.backgroundColor = 'lime'

This seems easier than the current function: https://github.com/Anarios/return-youtube-dislike/blob/2e6ed5298b7851b7ea84dcfa298167689f516496/Extensions/combined/src/bar.js#L4

What about mobile and shorts?

cyrildtm avatar Apr 19 '22 03:04 cyrildtm