Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielherman committed Sep 13, 2021
1 parent beb1207 commit 5938a55
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ function defineVideoController() {
p.insertBefore(fragment, p.firstChild);
break;
case location.hostname == "tv.apple.com":
// pass-through, the latest version of AppleTV works with default behavior
// insert before parent to bypass overlay
this.parent.parentNode.insertBefore(fragment, this.parent.parentNode.firstChild);
break;
default:
// Note: when triggered via a MutationRecord, it's possible that the
// target is not the immediate parent. This appends the controller as
Expand Down Expand Up @@ -654,7 +656,8 @@ function initializeNow(document) {
(x) => x.tagName == "VIDEO"
);
for (let node of nodes) {
if (node.vsc)
// only remove old vsc for the case of aria-hidden change
if (node.vsc && mutation.target.attributes["aria-hidden"]?.value == "false")
node.vsc.remove();
checkForVideo(node, node.parentNode || mutation.target, true);
}
Expand All @@ -667,7 +670,7 @@ function initializeNow(document) {
);
});
observer.observe(document, {
attributes: true,
attributeFilter: ["aria-hidden", "data-focus-method"],
childList: true,
subtree: true
});
Expand Down

0 comments on commit 5938a55

Please sign in to comment.