0

I'm creating a web plugin for youtube, however im facing some issues like Suppose we are on youtube home page, now how would i know if some new video has been loaded in our home page(like whenever we open the youtube page first 24 videos are loaded and then as we scroll down more 24 are loaded and so on..) and i want to detect this change so i can do my analysis accordingly.

Also im using mutationobserver and i've tried with document.location.href, however this only gives the root url i.e https://www.youtube.com/ and using this i cannot detect any change in content.

Abhishek Jha
  • 163
  • 1
  • 11
  • Does this answer your question? [Is there a JavaScript / jQuery DOM change listener?](https://stackoverflow.com/questions/2844565/is-there-a-javascript-jquery-dom-change-listener) If it doesn't, show your code, because MutationObserver is the right tool for that. – wOxxOm Apr 05 '22 at 18:40
  • thanks for your ref, but i tried using document.querySelectorAll("tag-name") and this gives me all the elements associated with that tag in the web page, so once this changes there is definitely a change in web page and this way its much easier. – Abhishek Jha Apr 06 '22 at 09:10

0 Answers0