Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Get we get "?utm_source=..." removed from the URL?


I wonder if there's a FF add-on that can strip query parameters by default on a cross-domain request?



I edited the bookmarklet:

  javascript:window.location="http://news.ycombinator.com/submitlink?u="+encodeURIComponent((document.location+'').replace(/.utm_.*$/,''))+"&t="+encodeURIComponent(document.title)


Shouldn't you replace before URL-encoding?


It doesn't seem to matter. It's not as if "utm_" encodes to anything other than "utm_".


But encoded "?" is "%3F".


Hmmm, I have seen an extra '%3' occasionally... it never hurt anything so I didn't bother fixing it. Thanks dude now I'm going to be totally tormented until I fix my bookmarklet.

[EDIT:] ok moving that parenthesis and avoiding the update of document.location didn't take me too long...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: