I am trying to push a URL with a url encoded hashtag (I’m building a Twitter client). History.js apparently considers URI encoded hashtags (%23) as hash parameters in the URL so automatically URL decodes them, hence triggers no state change with such links.
For example the url /first/%23second gets converted as /first/#second
What could I do without messing up the whole plugin?
If you host the History.js file locally, look inside for a function on the m object called “unescapeString” (or just Ctrl+F to “m.unescapeString”.
You can then change it to this:
This will basically fix your issue. (I believe that this method is used for supporting browsers that don’t support history.pushState)