Skip to content

Commit 611ceae

Browse files
committed
Shortened element arg name to elem ↞ [auto-sync from https://github.com/adamlui/youtube-classic]
1 parent 7382e7f commit 611ceae

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

youtube-classic/youtube-classic.user.js

Lines changed: 10 additions & 10 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.44
3+
// @version 2026.1.17.45
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
@@ -604,13 +604,13 @@
604604
} catch (err) {}
605605
return thread
606606
}
607-
function refreshData(element) {
608-
const clone = element.cloneNode()
609-
clone.data = element.data
607+
function refreshData(elem) {
608+
const clone = elem.cloneNode()
609+
clone.data = elem.data
610610
clone.data.fixedByCF = true
611-
for (const i in element.properties) clone[i] = element[i]
612-
element.insertAdjacentElement('afterend', clone)
613-
element.remove()
611+
for (const i in elem.properties) clone[i] = elem[i]
612+
elem.insertAdjacentElement('afterend', clone)
613+
elem.remove()
614614
}
615615
const commentObserver = new MutationObserver(mutations => mutations.forEach(async mutation => {
616616
if (mutation.addedNodes) for (const elem of mutation.addedNodes) if (elem.classList && !elem.data?.fixedByCF)
@@ -1217,12 +1217,12 @@
12171217
console.log(`[Return YouTube Dislikes] ${text} ${subtext}`)
12181218
}
12191219

1220-
function isInViewport(element) {
1221-
const rect = element.getBoundingClientRect()
1220+
function isInViewport(elem) {
1221+
const rect = elem.getBoundingClientRect()
12221222
const height = innerHeight || document.documentElement.clientHeight
12231223
const width = innerWidth || document.documentElement.clientWidth
12241224
return (
1225-
// When short (channel) is ignored, the element (like/dislike AND short itself) is
1225+
// When short (channel) is ignored, the elem (like/dislike AND short itself) is
12261226
// hidden with a 0 DOMRect. In this case, consider it outside of Viewport
12271227
!(rect.top == 0 && rect.left == 0 && rect.bottom == 0 && rect.right == 0) &&
12281228
rect.top >= 0 &&

0 commit comments

Comments
 (0)