test
parent
fb9e77d32e
commit
d99698f290
|
@ -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 %}
|
Loading…
Reference in New Issue