Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Created May 27, 2011 23:17
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlrobinson/996381 to your computer and use it in GitHub Desktop.
Save tlrobinson/996381 to your computer and use it in GitHub Desktop.
Hack to make NewTwitter use HTML5 pushState instead of annoying hash fragments.
twttr.secrets.html5Routing = true;
twttr.router._changeUrlAndCallAction = function(p) {
return twttr.Router.prototype._changeUrlAndCallAction.call(this, p.replace("#!/", ""));
}
twttr.router._changeUrlAndCallAction(window.location.hash);
@tlrobinson
Copy link
Author

To try it out just load up a Twitter page and copy the code into the JavaScript console.

This could be put in a browser extension / user script. It should be run after all of the Twitter JavaScript has been initialized.

It hasn't been tested much but seems to work.

@ravikiranj
Copy link

deadly !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment