Feature/#94 auto resume after screenshot #101

Merged
Serraniel merged 4 commits from feature/#94-auto-resume-after-screenshot into develop 2020-10-28 19:25:08 +01:00
Showing only changes of commit f8b0dbbe3f - Show all commits

View file

@ -1,10 +1,26 @@
import * as core from '../utils/aniwatchCore'; import * as core from '../utils/aniwatchCore';
import * as helper from '../utils/helpers'; import * as helper from '../utils/helpers';
const SCREENSHOT_TOOLTIP_ID = 'anilyr-screenshots-tooltip';
export function init() { export function init() {
core.registerScript(node => { core.registerScript(node => {
// run the scripts if (helper.isHtmlElement(node) && node.id === SCREENSHOT_TOOLTIP_ID) {
observeScreenshotTooltip(node);
}
}, "^/anime/[0-9]*/[0-9]*$"); }, "^/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'],
});
}