4 ms·
This post motivated me to figure out how to hack pushState support into NewTwitter: twttr.secrets.html5Routing = true; twttr.router._changeUrlAndCallAc
by tlrobinson 15y ago
This post motivated me to figure out how to hack pushState support into NewTwitter:
twttr.secrets.html5Routing = true;
twttr.router._changeUrlAndCallAction = function(p) {
return twttr.Router.prototype._changeUrlAndCallAction.call(this, p.replace("#!/", ""));
}
twttr.router._changeUrlAndCallAction(window.location.hash);
Turns out they already have pushState() support... but it uses fragment URLs. This code just enables it, and wraps one of the functions to strip the "#!/".
https://gist.github.com/996381 https://gist.github.com/996381