Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
strips query string from selected URLs on page
// strip query string (or search params) from "/xyz/..". URLs
for (let a of document.querySelectorAll('a[href^="/xyz/"]')) {
let u = new URL(a.href.toString());
u.search = '';
a.href = u;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.