Detect page change with 2sxc app in Blazor/Oqtane

Since Blazor and Oqtane are SPA, content is added to the DOM with no actual load to be always detected.

Also, 2sxc still does not seem to work with Blazor / .net on the client browser.

This leaves quite a few usual cases like every “on page load” with no options for easy implementation.

So, resorting only to common razor server side code and plain javascript, how can I trigger a js function every time a page is shown, either for the first time or recurrent accesses with no forced reloads?

Let’s say a simple:

<script src="sayhello.js"></script>

and

function showalert(){
    alert("This is page ABC");
}
window.onload = showalert();