visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Filename is lost on routing to root #491

Open AGoblinKing opened 5 years ago

AGoblinKing commented 5 years ago

The filename component of location is lost when you navigate to "/".

EX:

This comes up when using history.back() as well.

NikanV commented 1 year ago

Hi, i just made a pr and fixed the problem. the first problem was that you should've used

history.pushState(...);

instead of

history.replaceState(...);

and the second one was that you could use location.href in clickHandler function instead of pathname, search, and hash properties. make sure to inform me if anything was wrong with it.