Reform-to / reform.to

Website
1 stars 0 forks source link

Remove the query string from current location #15

Closed spl closed 10 years ago

spl commented 10 years ago

This makes the browser address bar look better when you're coming from links with all the analytics in the query string.

christopheradams commented 10 years ago

Thanks for the pull request, I'll look at merging this in. For the record, can you give an example of the kind of analytics query string that this fixes, since we don't have any tests in this repository?

spl commented 10 years ago

It removes all query strings, so http//reform.to/?query&string#hash becomes http//reform.to/#hash. I didn't see any use of query strings for navigating around the app, so it appeared safe. If you do use query strings for in-app routes — that is, not incoming-only URLs — then you don't want this.

I used try ... catch for browsers that don't support the browser history API. In those cases, nothing changes.

christopheradams commented 10 years ago

This is perfect for getting rid of the ?utm_source= on inbound links. Thanks!