Is there a new way to get a Javascript event when page URL changes? Discourse.PageTracker.current is not working for me.
I’ve had some luck with something like this. (May not be the most optimal way )
<script type="text/discourse-plugin" version="0.8.16">
api.onPageChange(() => {
foo();
});
function foo() {
// do stuff
console.log(" foo loaded");
}
</script>
2 Likes
Thank you! That seems to be the best way currently. Also found it referenced here:
2 Likes