MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / isInsideYoutubeVideo

Function isInsideYoutubeVideo

scripts/smoothScroll.js:764–775  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

762 }
763 });
764 function isInsideYoutubeVideo(event) {
765 let elem = event.target;
766 let isControl = false;
767 if (document.URL.indexOf("www.youtube.com/watch") != -1) {
768 do {
769 isControl =
770 elem.classList && elem.classList.contains("html5-video-controls");
771 if (isControl) break;
772 } while ((elem = elem.parentNode));
773 }
774 return isControl;
775 }
776 function getScrollRoot() {
777 return document.scrollingElement || document.body; // scrolling root in WebKit
778 }

Callers 1

keydownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected