From 9eecf1c6be59ff3c04152390d7ce556e36965fd8 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 9 May 2020 00:32:16 +0200 Subject: Add documentation comments --- src/watch_credits.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/watch_credits.ts') diff --git a/src/watch_credits.ts b/src/watch_credits.ts index c6e2c7f..f41844a 100644 --- a/src/watch_credits.ts +++ b/src/watch_credits.ts @@ -20,6 +20,7 @@ import logger from './logger'; import wait_element from './wait_element'; +// Remove the "Watch Credits" button. function init_mutation_observer (controls_el) { const observer = new MutationObserver(function(mutation_list) { for (var i = 0; i < mutation_list.length; i++) { @@ -41,6 +42,8 @@ function init_mutation_observer (controls_el) { const pointer_event = new PointerEvent('pointerdown', { bubbles: true }); watch_credits_button.dispatchEvent(pointer_event); + // When playback controls return as a result of having pressed + // "Watch Credits", they become visible. Keep them hidden. controls.hide(); return; @@ -57,6 +60,7 @@ function init_mutation_observer (controls_el) { ); } +// Initialise the mutation observer when playback controls become available. export default function init () { wait_element('.PlayerControlsNeo__all-controls') .then(function(controls_el) { -- cgit v1.2.3