INNER CODE UNIT · TypeScript
startConversationWindowObserver
sindresorhus/caprine · source/autoplay.ts:121
function startConversationWindowObserver(): void {
conversationDivObserver.observe(document.documentElement, {
childList: true,
subtree: true,
});
}
function startVideoObserver(element: Element): void {
videoObserver.observe(element, {
childList: true,
subtree: true,
});
}
// A way to hold reference to conversation part of the document
// Used to refresh `videoObserver` after the conversation reference is lost
let conversationWindow: Element;
const conversationDivObserver = new MutationObserver(_ => {