Help with firefox Extension - Event listener for when 'next video' is about to be loaded?

I am learning/experimenting with extensions for Firefox. I have figured quite a few things (mostly thanks to the amazing MDN guides)

One thing I cant wrap my head around is how to work with pages that have a “playlist”, such as a YouTube playlist, like this one Modest Mouse live or a Udemy course Playlist, where videos are set to ‘auto play’, so the next video automatically plays.

I want to be notified as soon as the next video is about to be loaded or at least after it has been loaded, so that I can perform my own handling.

To me, this seems even more difficult in the case of a Udemy course playlist. which does not reload the web page but just the video player, merely replacing the old video with the new one.

Observing these kinds of pages with the Dev Tools, I can see that when current video ends, a few Https/Rest requests are made but I am not sure how to “hook” into these, or if its even possible.

Please share with me any possible solutions, ideas or documentation. My search has turned up nothing, maybe I am just not using the right words.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.