Sadly this does not work for me. What I need is to replace the current url, e.g. www.somepage.sth?param=1#/foo, with another one which has one additional parameter - www.somepage.sth?param=1&newParam=foo#/foo
The router.replace function "normalizes" the string to only get the fragment, so in practice it will just replace the fragment part (i.e. #/foo).
What I want to do is to pass the fragment part of the url (#/foo) to the server on page refresh, but only parameters are passed to the server (running asp mvc), so on each change of the router I want to add the information as parameter, I can change the url with history.replaceState, but the router navigation does not work properly after that.