0

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.

Epic Programmer
  • 383
  • 3
  • 12
  • 1
    See [this answer](https://stackoverflow.com/a/39508954). In modern Chrome you can use `navigation` API. – wOxxOm Sep 07 '22 at 18:47

0 Answers0