JS event when URL changes

Viewed 18

I am writing a userscript for a SPA site with client-side routing. I want to run code every time the URL changes (navigation of an SPA), but I do not know which window event to hook onto. The popstate event only works when the back button is used, which is not the case in an SPA.

0 Answers
Related