html5 - chrome goes back 2 times instead of one time when using history.pushState/location.hash -


  1. open new tab in chrome (opens http://google.com example)

  2. open testpage.htm containing history.pushstate({},"test","#lightbox"); changes url testpage.htm#lightbox

  3. if hit button of chrome url changed http://google.com, 2 states back, not one

firefox , msie10 work both good, it's chrome issue how can fix this? there workaround?

thank in advance

(feel free give question better title , feel free correct english)


notes:

on step 2 can use window.location.hash = "#lightbox" same issue

on step 3 can simulate button within code, using history.back() , in case url switched correct 1 testpage.htm, related button of chrome's gui

i tried

window.addeventlistener("popstate", function(ev){ ev.preventdefault(); }); window.addeventlistener("hashchange", function(ev){ ev.preventdefault(); }); 

without success :(


update 2: same using history.js


Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -