Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why don't Youtube comments fire a DOM mutation?

I'm developing a Google Chrome extension. Its content script should fire every time the page it's on changes, and it does most of the times. I'm using a MutationObserver for this.

However, when I'm on Youtube (and possibly other websites in which I haven't noticed the problem) and I scroll down to load the comments, the MutationObserver doesn't fire. Why is this, shouldn't the DOM have changed?

EDIT: I might want to add that I set the observer to monitor changes in the subtree, childList and attribute of document.body.

like image 299
KappaG3 Avatar asked Dec 06 '25 14:12

KappaG3


1 Answers

YouTube comments are loaded in an iframe. If you want to watch for mutations of YouTube comments you have to set your content script to be "all_frames": true in the manifest and add the iframe URL pattern to match against.

like image 62
abraham Avatar answered Dec 08 '25 05:12

abraham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!