Skip to content

Commit 6cd2770

Browse files
committed
Added Hide Playables option
1 parent b670f98 commit 6cd2770

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

youtube-classic/youtube-classic.user.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name YouTube™ Classic 📺 — (Remove rounded design + Return YouTube dislikes)
3-
// @version 2025.10.18
3+
// @version 2025.10.18.1
44
// @author Adam Lui, Magma_Craft, Anarios, JRWR, Fuim & hoothin
55
// @namespace https://github.com/adamlui
66
// @description Reverts YouTube to its classic design (before all the rounded corners & hidden dislikes) + redirects YouTube Shorts
@@ -54,6 +54,8 @@
5454
helptip: 'Redirect Shorts to classic wide player' },
5555
shortsBlock: { type: 'toggle', label: 'Hide Shorts', defaultVal: true,
5656
helptip: 'Hide Shorts from appearing in home page + results' },
57+
playablesBlock: { type: 'toggle', label: 'Hide Playables', defaultVal: true,
58+
helptip: 'Hide Playables from appearing in home page' },
5759
adBlock: { type: 'toggle', label: 'Block Ads', defaultVal: false,
5860
helptip: 'Hide ad thumbnails from homepage layouts' },
5961
aiBlock: { type: 'toggle', label: 'Block AI Summaries', defaultVal: true,
@@ -294,9 +296,9 @@
294296
homeObserver[config.adBlock ? 'observe' : 'disconnect'](document.documentElement, obsConfig)
295297
if (options?.updatedKey.includes('Block'))
296298
window.configStyle.textContent = `
297-
${ !config.shortsBlock ? '' : `${extractSelectors(domSelectors.shorts).join(',')} { display: none }`}
298-
${ !config.adBlock ? '' : `${extractSelectors(domSelectors.ads).join(',')} { display: none }`}
299-
${ !config.aiBlock ? '' : `${domSelectors.aiSummary} { display: none }`}`
299+
${ !config.shortsBlock ? '' : `${extractSelectors(domSelectors.shorts).join(',')} { display: none }` }
300+
${ !config.adBlock ? '' : `${extractSelectors(domSelectors.ads).join(',')} { display: none }` }
301+
${ !config.aiBlock ? '' : `${domSelectors.aiSummary} { display: none }` }`
300302
toolbarMenu.refresh() // prefixes/suffixes
301303
}
302304

@@ -2227,19 +2229,21 @@
22272229
} else if (locationPath == '/') { // remove homepage stuff
22282230
const adSlot = document.querySelector('ytd-ad-slot-renderer')
22292231
const richSection = document.querySelector(
2230-
`ytd-rich-section-renderer${ !config.shortsBlock ? ':not(:has(a[href*="/shorts/"]))' : '' }`)
2232+
`ytd-rich-section-renderer${ !config.shortsBlock ? ':not(:has(a[href*="/shorts/"]))' : '' }${
2233+
!config.playablesBlock ? ':not(:has(a[href*="/playables/"]))' : '' }`
2234+
)
22312235
adSlot?.closest('[rendered-from-rich-grid]')?.remove() ; richSection?.remove()
22322236
}
22332237
})
2234-
if (config.shortsBlock || config.adBlock)
2238+
if (config.shortsBlock || config.playablesBlock || config.adBlock)
22352239
getLoadedElem('html').then(() => homeObserver.observe(document.documentElement, obsConfig))
22362240

22372241
// Block stuff
22382242
document.head.append(window.configStyle ??= document.createElement('style'))
22392243
window.configStyle.textContent = `
2240-
${ !config.shortsBlock ? '' : `${extractSelectors(domSelectors.shorts).join(',')} { display: none }`}
2241-
${ !config.adBlock ? '' : `${extractSelectors(domSelectors.ads).join(',')} { display: none }`}
2242-
${ !config.aiBlock ? '' : `${domSelectors.aiSummary} { display: none }`}`
2244+
${ !config.shortsBlock ? '' : `${extractSelectors(domSelectors.shorts).join(',')} { display: none }` }
2245+
${ !config.adBlock ? '' : `${extractSelectors(domSelectors.ads).join(',')} { display: none }` }
2246+
${ !config.aiBlock ? '' : `${domSelectors.aiSummary} { display: none }` }`
22432247
function extractSelectors(obj) {
22442248
return Object.values(obj).flatMap(val => typeof val == 'object' ? extractSelectors(val) : val) }
22452249

0 commit comments

Comments
 (0)