Skip to content

Youtube - Spoiler videos with keywords by Freeplay

Imported and mirrored from https://codeberg.org/Freeplay/UserStyles/raw/branch/main/youtube-spoiler.user.css

Screenshot of Youtube - Spoiler videos with keywords

Details

AuthorFreeplay

LicenseNo License

CategoryYoutube

Created

Updated

Size3.0 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Censor videos while browsing

Notes

Make sure to add your keywords in the style's options!

Source code

/* ==UserStyle==
@name           Youtube - Spoiler videos with keywords
@version        1.0.7
@description    Censor videos while browsing
@preprocessor   stylus

 -- AUTHOR STUFF --
@namespace      Freeplay
@author         Freeplay (https://freeplay.codeberg.page/)
@homepageURL    https://codeberg.org/Freeplay/UserStyles
@supportURL     https://codeberg.org/Freeplay/UserStyles/issues

@var text keywords "Keywords (CASE SENSITIVE)" "Enter words here"
==/UserStyle== */

@-moz-document domain("youtube.com") {
    /* Insert code here... */

.ytp-videowall-still,
ytd-grid-video-renderer, ytd-video-renderer, ytd-rich-grid-media, 
ytd-playlist-renderer, ytd-playlist-panel-video-renderer, ytd-playlist-video-renderer, ytd-grid-playlist-renderer, ytd-compact-video-renderer,
ytd-playlist-sidebar-primary-info-renderer {
	overflow hidden
	#details {
		position relative
		z-index 2
	}
	#meta {
		overflow visible !important
	}
	.title-and-badge, #title-wrapper, #content {
		overflow visible !important
	}
	#video-title-link, #video-title {
		// opacity .5
		for row in keywords {

			&[aria-label*={row}]:not(#video-title-link),
 			&[title*={row}]:not(#video-title-link),
 			^[0].ytp-videowall-still[aria-label*={row}] {
				// filter blur(10px)
				&:not(.ytp-videowall-still) {
					overflow visible !important
					z-index 2
					position relative
				}
				
				font-size 0 !important
				&::after {
					content ""
					position absolute
					inset -400px
					bottom calc(100% + 8px)

					background-color black
					color white
					
					^[0].ytd-item-section-renderer ^[1..-1],
 					^[0].ytd-vertical-list-renderer ^[1..-1]{
						box-shadow -560px 400px black,
									400px 500px var(--yt-spec-general-background-a)
						// bottom -900px
						// right calc(100% + 15px)
						// box-shadow 400px 0
					}
					^[0].ytd-playlist-video-list-renderer ^[1..-1],
 					^[0].ytd-playlist-panel-renderer ^[1..-1],
 					^[0].ytd-item-section-renderer ^[1..-1],
 					^[0].ytd-watch-next-secondary-results-renderer ^[1..-1] {
						bottom -200px
						right calc(100% + 8px)
						background-color var(--yt-spec-general-background-b)
					}
					^[0].ytd-playlist-panel-renderer ^[1..-1] {
						background-color var(--yt-spec-general-background-a)
					}
					^[0].ytp-videowall-still::after {
						inset 0 !important
						top 0 !important
						bottom 0 !important
						box-shadow none !important
						// opacity 0 !important
					}
					
				}
				&::before {
					content "Spoilered, hover to view"
					font-size 1.4rem
				}
				^[0].ytp-videowall-still::before {
					position absolute !important
					inset 0 !important
					z-index 2
					display flex
					justify-content center
					align-items center
				}
			}
		}
	}
	&:hover {
		#video-title-link, #video-title#video-title, &.ytp-videowall-still {
			font-size 1.2em !important
			transition all 0s 1s
			&::before, &::after {
				font-size 0
				opacity 0
				transition all 0s 1s
			}
		}
	}
}
	
	
	
	
}

Reviews

No reviews yet.