jashkenas / backbone

Give your JS App some Backbone with Models, Views, Collections, and Events
http://backbonejs.org
MIT License
28.1k stars 5.39k forks source link

Fix navigate with replace: true and diacriticals/unicode characters in the hash #4175

Open gwynjudd opened 6 years ago

gwynjudd commented 6 years ago

It seems there is a change in chrome 63 (also similarly introduced a while ago in some earlier version of iOS Safari) where the hash portion of the location.href is encoded, where it used to be decoded

Fixes https://github.com/jashkenas/backbone/issues/4085

gwynjudd commented 6 years ago

Anyone reading this, I couldn't actually get the added unit tests to "successfully fail". The reason being, it seems that running in karma-chrome-launcher, the 'hashchange' event never actually fires so the checkUrl method isn't called. Despite this, I added the tests in the hope that somebody could figure that out. I can verify that the change does actually work by manually testing it in various contexts.