balupton/history.js — Issue #156: pushState should refresh page when passed the current location
Author: cmer
Created: 2012-02-05 21:10:46+00:00
State: open

My users want to refresh the page when clicking on a link that technically links to the page they're already on. For example, clicking the logo of a website on the index page would typically reload the index page. With History.js, it has no effect.

I tried a little hack which also didn't work:

var currentLocation = "/" + History.getState().url.replace(History.getRootUrl(), "");
if (currentLocation== url) {
console.log("Refresh");
History.replaceState(null,title,url);
} else {
History.pushState(null,title,url);
}

Am I missing something is is this a bug or oversight? Thanks!