Skip to content

Commit 7ae0a5c

Browse files
committed
Condensed YTP members ↞ [auto-sync from https://github.com/adamlui/youtube-classic]
1 parent e65f696 commit 7ae0a5c

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

youtube-classic/youtube-classic.user.js

Lines changed: 8 additions & 16 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 2026.1.17.50
3+
// @version 2026.1.17.51
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
@@ -370,30 +370,22 @@
370370
class YTP {
371371
static observer = new MutationObserver(this.onNewScript)
372372
static _config = {}
373-
static isObject(item) {
374-
return (item && typeof item == 'object' && !Array.isArray(item))
375-
}
373+
static isObject(item) { return (item && typeof item == 'object' && !Array.isArray(item)) }
376374
static mergeDeep(target, ...sources) {
377375
if (!sources.length) return target
378376
const source = sources.shift()
379-
if (this.isObject(target) && this.isObject(source)) {
380-
for (const key in source) {
381-
if (this.isObject(source[key])) {
382-
if (!target[key]) Object.assign(target, { [key]: {} })
383-
this.mergeDeep(target[key], source[key])
384-
} else {
385-
Object.assign(target, { [key]: source[key] })
386-
}
387-
}
388-
}
377+
if (this.isObject(target) && this.isObject(source)) for (const key in source)
378+
if (this.isObject(source[key])) {
379+
if (!target[key]) Object.assign(target, { [key]: {} })
380+
this.mergeDeep(target[key], source[key])
381+
} else Object.assign(target, { [key]: source[key] })
389382
return this.mergeDeep(target, ...sources)
390383
}
391384
static onNewScript(mutations) { if (mutations.some(mut => mut.addedNodes.length)) YTP.bruteforce() }
392385
static start() { this.observer.observe(document, {childList: true, subtree: true}) }
393386
static stop() { this.observer.disconnect() }
394387
static bruteforce() {
395-
if (!unsafeWindow.yt) return
396-
if (!unsafeWindow.yt.config_) return
388+
if (!unsafeWindow.yt?.config_) return
397389
this.mergeDeep(unsafeWindow.yt.config_, this._config)
398390
}
399391
static setCfg(name, value) { this._config[name] = value }

0 commit comments

Comments
 (0)