Skip to content

Instantly share code, notes, and snippets.

@apstndb
Last active June 6, 2019 10:52
Show Gist options
  • Select an option

  • Save apstndb/ef598f9637cc7bf548bf734b4a5e0c5d to your computer and use it in GitHub Desktop.

Select an option

Save apstndb/ef598f9637cc7bf548bf734b4a5e0c5d to your computer and use it in GitHub Desktop.
javascript:
let queries=location.search.length===0?{}:location.search.substr(1).split('&').reduce((p,c)=>{const cs=c.split('=');return Object.assign(p,{[cs[0]]:cs[1]})},{});
queries["hl"]="en";
location.search = "?" + Object.keys(queries).map(k => k + "=" + queries[k]).join("&");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment