Feedback zu "on-discourse" Javascript für die Einrichtung von benutzerdefiniertem JS für jede Seite?

I just tried to use a popstate event observer. If that would have worked, then the code would be 5 lines instead of 20. However, clicking around does not seem to trigger that event. If I use the forward or back buttons, I do see the event. I don’t obviously understand popstate enough but for now I am sticking with a div mutation observer.