JamesSekcienski
Community Coach
Community Coach

Instead of using DOMContentLoaded, you could try checking if the window is loaded.

window.addEventListener("load", () => {
  // Do stuff
});

 You could also set-up a MutationObserver.  This should provide the quickest update once the detected content is loaded, but it is also more complex to set-up.

The Best Practices for Using Global JavaScript InstructureCon 2013 presentation also has an example of an onElementRendered function you could use to continue to check for an element and then do something once it finds it or stops trying after a certain number of attempts>

View solution in original post

Who Me Too'd this solution