From da96a33c95b37bf7f98f517e6667e2f0feda379e Mon Sep 17 00:00:00 2001 From: Jonathan Dawson Date: Sat, 9 Nov 2019 13:06:26 -0600 Subject: [PATCH] change the input for shadowMutations function --- inject.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/inject.js b/inject.js index aed1d6b..311c7f1 100644 --- a/inject.js +++ b/inject.js @@ -409,7 +409,7 @@ } } - var observer = new MutationObserver(function(mutations) { + function mutationCallback(mutations) { // Process the DOM nodes lazily requestIdleCallback(_ => { mutations.forEach(function(mutation) { @@ -425,7 +425,8 @@ }); }); }, {timeout: 1000}); - }); + } + var observer = new MutationObserver(mutationCallback); observer.observe(document, { childList: true, subtree: true }); if (tc.settings.audioBoolean) { @@ -445,9 +446,9 @@ initializeWhenReady(childDocument); }); - //look for video in shadowRoot + //look for video in shadowRoot for apple tv if (document.querySelector('apple-tv-plus-player')) { - console.log('Congratulations. There is the apple-tv-plus-player.') + shadowMutations('apple-tv-plus-player', mutationCallback, {childList: true, subtree: true}) } // start of ally.js/src/observe/shadow-mutations.js