Git Product home page Git Product logo

youtube-hide-watched's Introduction

youtube-hide-watched

A simple userscript for toggling visibility of watched videos in YouTube, on your Subscriptions page and elsewhere on the site. Also provides a toggle to hide YouTube Shorts.

Installation

How to Use

The script adds two small buttons at the top of the page, see screenshot below. Pressing the "Watched Videos" button cycles through showing watched videos normally, then dimmed, then entirely hidden. Pressing the "Shorts" button cycles through showing shorts normally, then dimmed, then entirely hidden.

You will see the buttons at the top of the page, to right of the Search box.

screenshot

The "Watched Videos" button keeps track of different areas of YouTube separately. This allows you to hide watched videos on the Subscriptions page, show watched as dimmed in the sidebar recommendations, and show watched normally on channel pages. Here are the areas that the button keeps track of separately:

  • Subscriptions page
  • Channel pages
  • Trending page
  • Recommendations sidebar when watching a video
  • Playlist pages
  • Everywhere else

YouTube does not keep track of which Shorts you've watched, s the "Shorts" button dims/hides all Shorts.

youtube-hide-watched's People

Contributors

actionless avatar alexwh avatar dependabot-preview[bot] avatar dependabot[bot] avatar evhaus avatar jas32096 avatar mallardduck avatar netjeff avatar programie avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

youtube-hide-watched's Issues

Someone please just kill those bloody short abominations

Why do people even do this crap?
It is well known that this rubbish does nothing for the channel discoverability and also doesn't make any money.

Anyways, there are two rows of shorts in the search results now.
First is being hidden just okay, but not the second one.

Looks like this:

/html/body/ytd-app/div[1]/ytd-page-manager/ytd-search/div[1]/ytd-two-column-search-results-renderer/div/ytd-section-list-renderer/div[2]/ytd-item-section-renderer/div[3]/ytd-reel-shelf-renderer[2]

html.efyt-control-bar-visible.vzmjhcsg.owkxwde body ytd-app div#content.style-scope.ytd-app ytd-page-manager#page-manager.style-scope.ytd-app ytd-search.style-scope.ytd-page-manager div#container.style-scope.ytd-search ytd-two-column-search-results-renderer.style-scope.ytd-search div#primary.style-scope.ytd-two-column-search-results-renderer ytd-section-list-renderer.style-scope.ytd-two-column-search-results-renderer div#contents.style-scope.ytd-section-list-renderer ytd-item-section-renderer.style-scope.ytd-section-list-renderer div#contents.style-scope.ytd-item-section-renderer ytd-reel-shelf-renderer.style-scope.ytd-item-section-renderer

Broken in Greasmonkey since 5.5

SyntaxError: Document.querySelector: 'ytd-reel-shelf-renderer:has(ytd-reel-item-renderer)' is not a valid selector

Fix for hiding shorts also doesn't work.

Firefox, Greasemonkey 4.11

shorts button .... New?

The shorts button does nothing when toggled. Greyed out or with a line through it and I'm still seeing shorts. Also, i don't ever remember seeing a shorts button when i first installed this userscript and had it worked, i would have no complaints. But seeing how it's not can't help but wish this was 2 separate scripts.

Please kill these short abominations one more time

Using 5.9, shorts started to appear in the search again.
Now they are mimicking non-short videos, except they are vertical and say "💩SHORTS" instead of showing a timer.

looks like

ytd-video-renderer.style-scope:nth-child(4) > div:nth-child(1) > ytd-thumbnail:nth-child(1) > a:nth-child(1) > div:nth-child(2) > ytd-thumbnail-overlay-time-status-renderer:nth-child(1) > div:nth-child(2) > span:nth-child(2)

or

html body ytd-app div#content.style-scope.ytd-app ytd-page-manager#page-manager.style-scope.ytd-app ytd-search.style-scope.ytd-page-manager div#container.style-scope.ytd-search ytd-two-column-search-results-renderer.style-scope.ytd-search div#primary.style-scope.ytd-two-column-search-results-renderer ytd-section-list-renderer.style-scope.ytd-two-column-search-results-renderer div#contents.style-scope.ytd-section-list-renderer ytd-item-section-renderer.style-scope.ytd-section-list-renderer div#contents.style-scope.ytd-item-section-renderer ytd-video-renderer.style-scope.ytd-item-section-renderer div#dismissible.style-scope.ytd-video-renderer ytd-thumbnail.style-scope.ytd-video-renderer a#thumbnail.yt-simple-endpoint.inline-block.style-scope.ytd-thumbnail div#overlays.style-scope.ytd-thumbnail ytd-thumbnail-overlay-time-status-renderer.style-scope.ytd-thumbnail div#time-status.style-scope.ytd-thumbnail-overlay-time-status-renderer span#text.style-scope.ytd-thumbnail-overlay-time-status-renderer

PS: they seem to be using the same ID "text" for each of these 💩 elements.
If there was a need for extra proof they are incompetent.

Does not work since recent YouTube style change

YouTube changed it's style a few days ago. Since then, the script does not work anymore.

The button to show/dim/hide watched videos appears but clicking on it does not change anything in the video list.

My browser console also does not show anything related to that.

Browser: Mozilla Firefox v106.0.2
Script version: v4.4.1
Userscript Manager: Tampermonkey v4.18.0

Script stops working today.

Script stops working today. Firefox 55.0.3. Youtube with old loock (not this new witch round icons) Yesterday works normaly.

Watched videos not hidden

First time user. Installed, reloaded, but watched videos are still showing in my https://www.youtube.com/feed/subscriptions.

Here's my env

  • Firefox 57.0.2, 64-bit, on Windows 10
  • version 2.5 of this script
  • Tampermonkey 4.5.5648
  • all other addons disabled

FYI, I am not using the old-style youtube.

I edited the script to enable debugging
var __DEV__ = true;

Here is the output in the browser console when I reload the page

[YT-HWV] Starting Script                   subscriptions%20line%202%20%3E%20Function:278
[YT-HWV] Attaching DOM listener            subscriptions%20line%202%20%3E%20Function:256
[YT-HWV] Running check for watched videos  subscriptions%20line%202%20%3E%20Function:225
[YT-HWV] Running check for watched videos  subscriptions%20line%202%20%3E%20Function:225

Not working for https://www.youtube.com/channel/<ID>/videos URL

I just noticed that when you are in videos section for specific channel, if the channel has a Channel ID instead of User ID, i.e. the URL is youtube.com/channel/..../videos instead of youtube.com/user/..../videos, the script does't work.

A simple fix is to replace line 163 from this:
} else if (window.location.href.match(/./user/.+/videos/)) {
to this:
} else if (window.location.href.match(/.
/(user|channel)/.+/videos/)) {

show/hide the sidebar recommendations

I really would like exactly the same button with show/hide the sidebar recommendations, nothing more. Probably it's much easier, but I can't do it. Can you make it please?

I tried to modify this, but doesn't really work: https://greasyfork.org/en/scripts/408887-youtube-hide-watched-videos/discussions/90432

I also have a FF add-on YT Clean (it does exactly what I want, except it doesn't remember the toggle stage), but I would like a button on the youtube page instead of the FF toolbar.

Broken and doesn't work at all

Script error in [Greasemonkey script https://www.haus.gg//YouTube: Hide Watched Videos; version 5.3]: YouTube: Hide Watched Videos:1477:19
ReferenceError: GM_registerMenuCommand is not defined

Firefox 113

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm eslint-config-globex Unavailable

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/workflow.yml
  • actions/checkout v4
  • pnpm/action-setup v2
  • actions/setup-node v4
npm
package.json
  • eslint-config-globex 7.7.2
  • eslint-plugin-userscripts 0.5.3
  • lefthook 1.6.18
  • prettier-package-json 2.8.0

  • Check this box to trigger a request for Renovate to run again on this repository

videos not being removed

videos are no longer being removed from my sub box. when i opened up the script and try to reload and run it it gave me an error saying this

/*
Exception: ReferenceError: GM_addStyle is not defined
@Scratchpad/4:21:5
@Scratchpad/4:19:2
*/

Difference between home page and channel page

If I click the hidden option for a home page, it stays on for the channel pages too and I have to turn it off as I dont want it there. Would it be possible for the script to remember home page and channel page as different pages with different setting? Just like it does for subscription page or playlist page?

Random Videos are hidden

I'm on Win 11, Firefox 103, Tampermonkey 4.17.6161 , Script Version 4.3.2. I'm not sure any of that matters though since I have had this problem for quite a while now. Months probably.

The script hides random videos on the Subscriptions page and the Home feed. Switching between the pages via the side bar doesn't change this. Reloading the page fixes the problem for a while until it returns.

A problem which is most likely connected is that the links to the YT channels (clicking the channel name under the video) are mixed up as well. So you click on channel X and channel Y will open. Reloading fixes this as well, temporarily.

the script again does not work

if Dan Pollock's hosts file is turn on in ublock addon
Firefox 51, greasemonkey,
i dont know witch exception i must add to list
i dont want to turn off whole Dan Pollock's list :/

Playlist Sidebar

When watching a video from a playlist (/watch?v=&list=), the videos (ytd-playlist-panel-video-renderer) in the playlist sidebar are currently not being handled.

The playlist sidebar is more prominent and more useful the regular sidebar in the case when watching a video from a playlist. What do you think?

Shorts hiding is broken

Was working just fine some time ago.
But today it doesn't do anything.

Please let me hide this cancer again.
It was so much better without this stupid crap.

Not working

The script is not hiding watch youtube videos on the subscription list.

image

Shorts not hidden.

"hidden"

"Dimmed":

Waterfox Classic, Violentmonkey v2.14.0, script 5.2

Needs update

it doesnt work on subscriptions page anymore.

The "Up Next" video not handled

In YT's list of recommended videos while watching a video, the first video aka "Up Next" is not handled when already watched. Not sure why YT's recommendation algorithm would suggest the "up next" to be an already watched. But clearly possible because I've seen this occasionally.

Fixing could be tricky. I'm sure detection is straightforward. But what to do next is trickier. If the Up Next follows regular logic, it would be entirely hidden when button says to entirey hide. But that would probably look weird. So seems like Up Next should be at most greyed out when watched?

I think it's rare enough that I don't have any plans to work on this. But thought I would open an issue just in case anyone else was interested in making changes.

Issue with Streamed Replay Videos

Love this script. If you watch a live-stream replay, the thumbnail in the subscription view does not contain .ytd-thumbnail-overlay-resume-playback-renderer, therefore it is not recognized as watched. Any thoughts?

New changes to Youtube's CSS

In a baffling move, Youtube team has decided to insert "row elements" inside their main container flexbox on the frontpage to encompass the video items 4 at a time. This stops this script from working correctly, because removed elements no longer affect the row container, which is set to partition space for 4 items regardless of whether or not they are actually displayed.

I have fixed it for myself by using the following CSS rules in my browser:

#contents.ytd-rich-grid-renderer{display:block; margin-left: 16px;}  
.ytd-rich-grid-renderer:first-child{margin-left:0;}  
.ytd-rich-grid-renderer{width: auto; display: inline; font-size:0;}  
ytd-rich-grid-row #contents.ytd-rich-grid-row{display: inline; vertical-align:top; margin: 0;}  
ytd-rich-item-renderer{width: 256px; display: inline-block; vertical-align:top;}

Effectively breaking the now-useless declaration of flexbox (what were they thinking???) and reverting it to a block of inline elements, which lets hidden elements be removed entirely. Note that this solution will not work for everybody since I hard-coded the width of the individual video element to 256px to fit 6 videos on a row. For a general solution, width calculated by percentages or calc() will have to be used.

Another point of note is the 'margin-left:-2px' line, this is to (crudely) fix the space (literal space element) that is inserted by browsers between inline elements if there are any line breaks or spaces in the HTML code. The 2 solutions to solve that is to either collapse the elements in the HTML document together (not possible as we do not control it), or set the font-size of the place between elements to 0, which is kinda hacky. Using negative margin of 2px coincides with the width of a space in my browser, but it will not be the same for every browser, so I am unsure how would you solve it for everybody.

Not working: Failed to execute 'observe' on 'MutationObserver'

Didn't use the script for a week, during that time the YouTube interface did change.
I saw that a new version of the plugin was issued, but today I noticed that the script do not hide the watched videos.

I got this error from the Chrome console.

Error running script: YouTube: Hide Watched Videos
TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.

Please show "Hide Watched" button on other channels aswell.

Please add the "Hide Watched" button to all channels that you visit.

When i have already watched a video, and go back to find it on a specific channel, it's hidden and i have to go back to my own subbox to turn "Hide Watched" off again.

Add a license?

Looking at the recommended community standards, it suggests adding a license. With multiple committers a license helps reduce misunderstanding from future committers. How about adding the MIT license, or even "The Unlicense" aka public domain? The repo's community page has a "Propose" button for license that makes it really easy to add one.

"Shorts" videos never dimmed/hidden

"Shorts" videos are never dimmed/hidden because YT doesn't track watchtime on "shorts" videos. The creator on one of my subscriptions has started posting a bunch of shorts, so I'm starting to think about how to handle the shorts. The best idea I've had so far is to add a new state to the button plus changing the final state:

  • State 0 - Shows everything
  • State 1 - Watched videos dimmed (shorts not dimmed because never watched)
  • State 2 - (new) Watched and all shorts dimmed
  • State 3 - (changed) Watched and all shorts hidden

Thought I'd share here to see if there are other ideas to handle shorts.

I'll probably eventually give this idea a try. I looked into the html, and picking out the "shorts" videos should be straightforward. For me the biggest challenge is getting a new icon for the new state.

Extension not working with new YouTube interface

Dear EvHaus,

I have been using your extension for quite some time now, and I must say it has been a real lifesaver for me. It has made it so much easier for me to find new content to watch on YouTube by hiding the videos that I have already seen.

However, recently, I have noticed that the extension is not working as expected with the new YouTube interface. The watched videos are no longer being hidden, and I am having trouble navigating through my feed. I have tried to uninstall and reinstall the extension, but it didn’t help.

I am writing to you to request your assistance with this issue. Could you please look into this and provide a solution? I would really appreciate it if you could update the extension to be compatible with the new YouTube interface.

Thank you so much for your time and effort in developing this extension. I hope to hear back from you soon.

Best regards,
Mihran

GM_addStyle undefined

When I try to use the script, I get the following error:

ReferenceError: GM_addStyle is not defined
Stack trace:
userScript/<@user-script:http%3A//www.globexdesigns.com//YouTube%3A%20Hide%20Watched%20Videos:387:5
userScript@user-script:http%3A//www.globexdesigns.com//YouTube%3A%20Hide%20Watched%20Videos:380:2
scopeWrapper@user-script:http%3A//www.globexdesigns.com//YouTube%3A%20Hide%20Watched%20Videos:648:9
@user-script:http%3A//www.globexdesigns.com//YouTube%3A%20Hide%20Watched%20Videos:361:17

It looks like this function doesn't exist anymore (source).

Browser: Firefox 57.0.2 (64bit, Linux)
Greasemonkey: 4.0

Watched videos are not beeing removed

Hello,
watched videos on the "Youtube main page" or in "Up next" section are not beeing hidden in the new youtube material design.

Reason:
In the function addClassToWatchedRows is the identifier of the "to be removed" row wrong: row = item.closest('ytd-video-renderer');.

Fix:
The filter-parameter of the closest method should be ytd-grid-video-renderer for "main Youtube page" and ytd-compact-video-renderer for "Up next" section.

My quick and dirty solution:
} else {
row = item.closest('ytd-compact-video-renderer');
if (!row)
row = item.closest('ytd-grid-video-renderer');
}

Comments are being removed

Unsure why this is happening, but comments on videos are disappearing once they're loaded. No adblock running.

Shorts sneaking in the middle of home page are not hidden

Another day, another issue.
Just saw a vertical piece of short crap on my youtube home.
Randomly sneaked in the middle of normal stuff.

Looked something like that:

/html/body/ytd-app/div[1]/ytd-page-manager/ytd-browse/ytd-two-column-browse-results-renderer/div[1]/ytd-rich-grid-renderer/div[6]/ytd-rich-grid-row[5]/div/ytd-rich-item-renderer[4]/div/ytd-rich-grid-slim-media/div[1]/ytd-thumbnail/a/yt-image/img

Or:

.yt-core-image--content-mode-scale-aspect-fit

Or even:

<!--css-build:shady--><!--css-build:shady--><div id="content" class="style-scope ytd-rich-item-renderer"><ytd-rich-grid-slim-media class="style-scope ytd-rich-item-renderer" remove-max-width="" lockup="true" is-short=""><!--css-build:shady--><!--css-build:shady--><div id="dismissible" class="style-scope ytd-rich-grid-slim-media">
  <ytd-thumbnail rich-grid-thumbnail="" use-hovered-property="" width="9999" class="style-scope ytd-rich-grid-slim-media" size="large" is-original-aspect-ratio="" computed-object-fit="CONTAIN" loaded=""><!--css-build:shady--><!--css-build:shady--><a id="thumbnail" class="yt-simple-endpoint inline-block style-scope ytd-thumbnail" aria-hidden="true" tabindex="-1" rel="null" href="/shorts/random-string">
  <yt-image alt="" ftl-eligible="" notify-on-loaded="" notify-on-unloaded="" class="style-scope ytd-thumbnail"><img alt="" style="background-color: transparent;" class="yt-core-image--fill-parent-height yt-core-image--fill-parent-width yt-core-image yt-core-image--content-mode-scale-aspect-fit yt-core-image--loaded" src="https://i.ytimg.com/vi/some-random-letters-and-numbers-which-I-do-not-feel-like-sharing-just-in-case"></yt-image>
  
  <div id="overlays" class="style-scope ytd-thumbnail"></div>
  <div id="mouseover-overlay" class="style-scope ytd-thumbnail"></div>
  <div id="hover-overlays" class="style-scope ytd-thumbnail"></div>
</a>
</ytd-thumbnail>
  <div id="details" class="style-scope ytd-rich-grid-slim-media">
    <h3 class="style-scope ytd-rich-grid-slim-media">
      <a class="yt-simple-endpoint focus-on-expand style-scope ytd-rich-grid-slim-media" href="/shorts/random-string" aria-label="label" title="title">
        <ytd-badge-supported-renderer class="style-scope ytd-rich-grid-slim-media" disable-upgrade="" hidden="">
        </ytd-badge-supported-renderer>
        <span id="video-title" class="style-scope ytd-rich-grid-slim-media">title</span>
      </a>
    </h3>
    <span id="metadata" class="style-scope ytd-rich-grid-slim-media" hidden="">
      
    </span>
    <ytd-video-meta-block class="grid style-scope ytd-rich-grid-slim-media byline-separated" rich-meta="" amsterdam-post-mvp=""><!--css-build:shady--><!--css-build:shady-->
<div id="metadata" class="style-scope ytd-video-meta-block">
  <div id="byline-container" class="style-scope ytd-video-meta-block" hidden="">
    <ytd-channel-name id="channel-name" class=" style-scope ytd-video-meta-block style-scope ytd-video-meta-block"><!--css-build:shady--><!--css-build:shady--><div id="container" class="style-scope ytd-channel-name">
  <div id="text-container" class="style-scope ytd-channel-name">
    <yt-formatted-string id="text" link-inherit-color="" title="" class="style-scope ytd-channel-name" is-empty="" ellipsis-truncate="" ellipsis-truncate-styling=""><!--css-build:shady--><!--css-build:shady--><yt-attributed-string class="style-scope yt-formatted-string"></yt-attributed-string></yt-formatted-string>
  </div>
  <tp-yt-paper-tooltip fit-to-visible-bounds="" class="style-scope ytd-channel-name" role="tooltip" tabindex="-1"><!--css-build:shady--><div id="tooltip" class="hidden style-scope tp-yt-paper-tooltip" style-target="tooltip">
  
    
  
</div>
</tp-yt-paper-tooltip>
</div>
<ytd-badge-supported-renderer class="style-scope ytd-channel-name" disable-upgrade="" hidden="">
</ytd-badge-supported-renderer>
</ytd-channel-name>
    <div id="separator" class="style-scope ytd-video-meta-block">•</div>
    <yt-formatted-string id="video-info" class="style-scope ytd-video-meta-block" is-empty="" hidden=""><!--css-build:shady--><!--css-build:shady--><yt-attributed-string class="style-scope yt-formatted-string"></yt-attributed-string></yt-formatted-string>
  </div>
  <div id="metadata-line" class="style-scope ytd-video-meta-block">
    
    <ytd-badge-supported-renderer class="inline-metadata-badge style-scope ytd-video-meta-block" system-icons="" hidden=""><!--css-build:shady--><!--css-build:shady--><dom-repeat id="repeat" as="badge" class="style-scope ytd-badge-supported-renderer"><template is="dom-repeat"></template></dom-repeat></ytd-badge-supported-renderer>
    <div id="separator" class="style-scope ytd-video-meta-block" hidden="">•</div>
    
      <span class="inline-metadata-item style-scope ytd-video-meta-block">46K views</span>
    <dom-repeat strip-whitespace="" class="style-scope ytd-video-meta-block"><template is="dom-repeat"></template></dom-repeat>
  </div>
</div>
<div id="additional-metadata-line" class="style-scope ytd-video-meta-block">
  <dom-repeat class="style-scope ytd-video-meta-block"><template is="dom-repeat"></template></dom-repeat>
</div>

</ytd-video-meta-block>
    <div id="menu" class="style-scope ytd-rich-grid-slim-media"><ytd-menu-renderer class="style-scope ytd-rich-grid-slim-media" safe-area=""><!--css-build:shady--><!--css-build:shady--><div id="top-level-buttons-computed" class="top-level-buttons style-scope ytd-menu-renderer"></div><div id="flexible-item-buttons" class="style-scope ytd-menu-renderer"></div><yt-icon-button id="button" class="dropdown-trigger style-scope ytd-menu-renderer" style-target="button"><!--css-build:shady--><!--css-build:shady--><button id="button" class="style-scope yt-icon-button" aria-label="More actions"><yt-icon class="style-scope ytd-menu-renderer"><!--css-build:shady--><!--css-build:shady--><yt-icon-shape class="style-scope yt-icon"><icon-shape class="yt-spec-icon-shape"><div style="width: 100%; height: 100%; fill: currentcolor;"><svg enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24" focusable="false" style="pointer-events: none; display: block; width: 100%; height: 100%;"><path d="M12 16.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zM10.5 12c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5-.67-1.5-1.5-1.5-1.5.67-1.5 1.5zm0-6c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5-.67-1.5-1.5-1.5-1.5.67-1.5 1.5z"></path></svg></div></icon-shape></yt-icon-shape></yt-icon></button><yt-interaction id="interaction" class="circular style-scope yt-icon-button"><!--css-build:shady--><!--css-build:shady--><div class="stroke style-scope yt-interaction"></div><div class="fill style-scope yt-interaction"></div></yt-interaction></yt-icon-button><yt-button-shape id="button-shape" version="modern" class="style-scope ytd-menu-renderer" disable-upgrade="" hidden=""></yt-button-shape></ytd-menu-renderer></div>
  </div>
  
  <dom-if class="style-scope ytd-rich-grid-slim-media"><template is="dom-if"></template></dom-if>
  
    <ytd-badge-supported-renderer class="video-badge style-scope ytd-rich-grid-slim-media" disable-upgrade="">
    </ytd-badge-supported-renderer>
  <dom-if class="style-scope ytd-rich-grid-slim-media"><template is="dom-if"></template></dom-if>
</div>
<div id="dismissed" class="style-scope ytd-rich-grid-slim-media">
  <div id="dismissed-content" class="style-scope ytd-rich-grid-slim-media"></div>
</div>
<yt-interaction id="interaction" class="extended style-scope ytd-rich-grid-slim-media"><!--css-build:shady--><!--css-build:shady--><div class="stroke style-scope yt-interaction"></div><div class="fill style-scope yt-interaction"></div></yt-interaction>
</ytd-rich-grid-slim-media></div>

Hider 5.6, greasemonkey 4.11, firefox.

Script do not work under channel Videos section (/user/foo/videos)

Ok, I did a little debugging and manage to figure out something.

So, the script does not work under channel Videos section (location ending with /videos).

In $(findWatchedElements()).each loop, because the location is not '/feed/subscriptions' it searches for class '.ytd-video-renderer', but in this page there are not such elements. Instead, it needs to search for class '.ytd-grid-renderer' as in '/feed/subscriptions'.
Not sure do I explain it right, as my JavaScript knowledge is very limited.

So, replacing this:

 if (window.location.href.indexOf('/feed/subscriptions') > 0) {
                row = item.closest('#grid-container');
                gridItem = item.closest('.ytd-grid-renderer');
            } else {
                row = item.closest('.ytd-video-renderer');
            }

with this:

 if (window.location.href.indexOf('/feed/subscriptions') > 0) {
                row = item.closest('#grid-container');
                gridItem = item.closest('.ytd-grid-renderer');
            } else if (window.location.href.match(/.*\/videos$/)) {
                row = item.closest('.ytd-grid-renderer');
            } else {
                row = item.closest('.ytd-video-renderer');
            }

make it works again.

Maybe it can be done better, but as I said, not my language.

No longer working for Chrome

Hi, love the script. It stopped working recently on the newer version of youtube (couldn't find youtube's version number).
Tested in regular youtube and in https://www.youtube.com/new (to use dark theme).
My browser:
Google Chrome is up to date
Version 64.0.3282.167 (Official Build) (64-bit)

Dimmed videos temporarily un-dim during "inline playback"

YT recently added an "inline playback" feature: When you hover, the thumbnail is replaced with the actual video playback. YT has a new setting to control inline playback, in "Settings", "Playback and Performance", "Browsing". Turning off inline playback restores the "auto-preview" feature, that shows a few seconds of playback on hover.

During the new inline playback, the video is un-dimmed. When you move the pointer away, the inline playback stops, and the video returns to dimmed. During the "auto preview" the video remains dimmed.

It would be nice if the videos remained dimmed even during inline playback (just like auto-preview). Often I unintentionally hover over watched/dimmed videos. I don't mind that YT starts playback, but the un-dimming catches my eye. So would be nice if the video remained dimmed during inline playback.

For me, I've turned off the new inline playback. But other's might like to keep it on, and yet still have dimmed videos remain dimmed during inline playback.

Issues with Greasemonkey under Firefox.

Since the Dec02 update, this script hasn't worked, so I've been using an older version until I had the time to figure out why it wasn't functional. The debug console is spammed with '$ is undefined', so I figured it was an issue loading jQuery.

I pasted the jQuery source above the script, and modified the addJQuery function, and it seems to be functional now. I'm assuming this is a Greasemonkey thing.

(Including a library that large for getting the width of an element seems over kill to me.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.