pull/1/head
Jan Umbach 2024-05-30 23:15:33 +02:00
parent fb9e77d32e
commit d99698f290
1 changed files with 9 additions and 0 deletions

View File

@ -111,6 +111,12 @@
videos.forEach(video => new ShxVideo(video));
});
// Assuming `document` is the target to observe
const targetNode = document;
// Options for the observer (which mutations to observe)
const config = { attributes: false, childList: true, subtree: true };
// watch out for new video elements with class "shx-video-card-product"
const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
@ -123,6 +129,9 @@
});
});
// Start observing the target node for configured mutations
observer.observe(targetNode, config);
</script>
{% endif %}