Last active
January 30, 2022 10:12
-
-
Save Phate334/47dbb728d41c98c1e41a77c3782da52a to your computer and use it in GitHub Desktop.
bookmarklet for removing Click identifier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (() => { | |
const blocked = new Set(['fbclid', 'utm_source', 'utm_medium', 'utm_campaign', 'ref_src', 'ref_url']); | |
let url = new URL(document.URL); | |
let params = new URLSearchParams(url.searchParams); | |
for (let key of params.keys()) { | |
if (blocked.has(key)) { | |
url.searchParams.delete(key); | |
} | |
} | |
let result = `${url.origin}${url.pathname}${url.searchParams.toString() ? '?' + url.searchParams.toString() : ''}${url.hash}`; | |
navigator.clipboard.writeText(result); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment