From db314ef5205a91ae16efd6af11f62ece67c4bb39 Mon Sep 17 00:00:00 2001 From: Ilya Grigorik Date: Tue, 29 Nov 2016 08:55:19 -0800 Subject: [PATCH] don't reinitialize active controllers --- inject.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/inject.js b/inject.js index 8df5968..9fa64f3 100644 --- a/inject.js +++ b/inject.js @@ -218,15 +218,7 @@ chrome.extension.sendMessage({}, function(response) { function checkForVideo(node, parent, added) { if (node.nodeName === 'VIDEO') { if (added) { - if (!node.classList.contains('vsc-initialized') && !node.dataset['vscid']) { - new tc.videoController(node, parent); - } - // if the video has already been initialized, then it has been mutated - // we may need to update the controller location to reflect this - else { - let id = node.dataset['vscid']; - let ctrl = document.querySelector(`div[data-vscid="${id}"]`); - if (ctrl) ctrl.remove(); + if (!node.dataset['vscid']) { new tc.videoController(node, parent); } } else {