From 4871ded5b5888cc2761d8871ec152b2956500e82 Mon Sep 17 00:00:00 2001 From: Jonathan Dawson Date: Fri, 3 Jan 2020 15:34:04 -0600 Subject: [PATCH] remove apple-tv tag, but add in a check for video tag. --- inject.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/inject.js b/inject.js index ad94d86..4426cbf 100644 --- a/inject.js +++ b/inject.js @@ -467,14 +467,16 @@ }); break; case 'attributes': - if ((mutation.target.tagName == 'APPLE-TV-PLUS-PLAYER') && (mutation.target.attributes['aria-hidden'].value == "false")) { + if (mutation.target.attributes['aria-hidden'].value == "false") { var flattenedNodes = getShadow(document.body) var node = flattenedNodes.filter(x => x.tagName == 'VIDEO')[0] - var oldController = flattenedNodes.filter(x => x.classList.contains('vsc-controller'))[0] - if (oldController) { - oldController.remove() + if (node) { + var oldController = flattenedNodes.filter(x => x.classList.contains('vsc-controller'))[0] + if (oldController) { + oldController.remove() + } + checkForVideo(node, node.parentNode || mutation.target, true); } - checkForVideo(node, node.parentNode || mutation.target, true); } break; };