From 800da3629e113d6b697b5f8c744e44303692b24c Mon Sep 17 00:00:00 2001 From: shinigami-eyes <43276258+shinigami-eyes@users.noreply.github.com> Date: Sun, 3 Mar 2019 21:27:45 +0100 Subject: [PATCH] Fixed youtube colored links due to dom node recycling --- extension/content.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extension/content.js b/extension/content.js index 0b86dd2..d8954a4 100644 --- a/extension/content.js +++ b/extension/content.js @@ -6,6 +6,7 @@ if (hostname.startsWith('www.')) { } if (hostname.endsWith('.reddit.com')) hostname = 'reddit.com'; if (hostname.endsWith('.facebook.com')) hostname = 'facebook.com'; +if (hostname.endsWith('.youtube.com')) hostname = 'youtube.com'; var myself = null; @@ -178,6 +179,7 @@ function updateYouTubeChannelHeader() { replacement.href = lastAppliedYouTubeUrl; } updateAllLabels(); + setTimeout(updateAllLabels, 2000); } function updateAllLabels(refresh) { @@ -227,7 +229,11 @@ function applyLabel(a, identifier) { function initLink(a) { var identifier = getIdentifier(a); - if (!identifier) return; + if (!identifier){ + if(hostname == 'youtube.com') + applyLabel(a, ''); + return; + } var label = knownLabels[identifier]; if (label === undefined) {