Skip to content

Instantly share code, notes, and snippets.

@mcenirm
Last active October 3, 2021 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcenirm/a8c2cdb3442ed6a83f07c56f1dcbd5ae to your computer and use it in GitHub Desktop.
Save mcenirm/a8c2cdb3442ed6a83f07c56f1dcbd5ae to your computer and use it in GitHub Desktop.
clean query parameters
location.search=location.search.replace(/^\?/,"&").replace(/\&(utm_[^=]*)(=[^&]*)?/g,"").replace(/^\&/,"?")
javascript:location.search%3Dlocation.search.replace%28%2F%5E%5C%3F%2F%2C%22%26%22%29.replace%28%2F%5C%26%28utm_%5B%5E%3D%5D*%29%28%3D%5B%5E%26%5D*%29%3F%2Fg%2C%22%22%29.replace%28%2F%5E%5C%26%2F%2C%22%3F%22%29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment