devote / HTML5-History-API

HTML5 History API expansion for browsers not supporting pushState, replaceState
http://spb-piksel.ru
MIT License
1.02k stars 182 forks source link

Fix isolation of pushState and replaceState #17

Closed nevar closed 11 years ago

nevar commented 11 years ago

If some user want add own hook on pushState:

oldPush = history.pushState;
history.pushState = function(state, title, url) {
    oldPush(state, title, url);
    document.title = title;
}

He will face up with problem that replaceState now work as pushState.

Private localPushState function solves this problem.

Also if some not attentive user write pushState(state, title, url, some) he also face up with the same problem.

Function for pushState solves this problem.

devote commented 11 years ago

Thanks for you commit!

Unfortunately, I can not make your changes in the branch. Since they do not completely solve the problem.

I made new changes to the branch, subject to your problem.