title: How can I detect when the official YouTube page's view/content changes in JavaScript?
body: <p>I'm developing a WebExtension for YouTube which should perform a set of actions once a watch/video page is reached, however, as the modern YouTube website is a single-page application, my content script is not run every time the content changes. </p>
  
  <p>My initial instinct was to look up a way of detecting when the browser URL changes, and while I did find a such feature (listening for hashchange), it only seems to apply when the fragment part (everything past the #) of the URL changes, which is not the case on YouTube. </p>
  
  <p>How can I detect when the content changes? </p>