Trigger javascript on clicking any page link, but before the page content loads?

This doesn’t seem to fire on entering a Topic from a Topic List?

I’ve also tried adding one:

      api.modifyClass("route:topic", {
        pluginId: PLUGIN_ID,
        actions: {
          willTransition() {

but that doesn’t fire either.