#94 Added empty observer for the player

This commit is contained in:
Serraniel 2020-10-26 20:42:34 +01:00
parent abb4c05857
commit f8b0dbbe3f
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3

View file

@ -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'],
});
}