From f8b0dbbe3fc45937d22e7faedf2fd283365cb07a Mon Sep 17 00:00:00 2001 From: Serraniel Date: Mon, 26 Oct 2020 20:42:34 +0100 Subject: [PATCH] #94 Added empty observer for the player --- src/javascript/enhancements/anilyr.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/javascript/enhancements/anilyr.js b/src/javascript/enhancements/anilyr.js index d0cda71..76db373 100644 --- a/src/javascript/enhancements/anilyr.js +++ b/src/javascript/enhancements/anilyr.js @@ -1,10 +1,26 @@ import * as core from '../utils/aniwatchCore'; import * as helper from '../utils/helpers'; +const SCREENSHOT_TOOLTIP_ID = 'anilyr-screenshots-tooltip'; + export function init() { core.registerScript(node => { - // run the scripts - + if (helper.isHtmlElement(node) && node.id === SCREENSHOT_TOOLTIP_ID) { + observeScreenshotTooltip(node); + } }, "^/anime/[0-9]*/[0-9]*$"); } +function observeScreenshotTooltip(tooltip) { + let observer = new MutationObserver(mutations => { + mutations.forEach(mutation => { + + }); + }); + + observer.observe(tooltip, { + attributes: true, + attributeOldValue: true, + attributeFilter: ['style'], + }); +} \ No newline at end of file