Last active
July 6, 2020 02:51
-
-
Save hehe24h/acfa46c57bc4f37a5ca6814cb1652537 to your computer and use it in GitHub Desktop.
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
(function () { | |
var param = 'fbclid'; | |
if (location.search.indexOf(param + '=') !== -1) { | |
var replace = ''; | |
try { | |
var url = new URL(location); | |
url.searchParams.delete(param); | |
replace = url.href; | |
} catch (ex) { | |
var regExp = new RegExp('[?&]' + param + '=.*$'); | |
replace = location.search.replace(regExp, ''); | |
replace = location.pathname + replace + location.hash; | |
} | |
history.replaceState(null, '', replace); | |
} | |
})(); | |
//https://www.michalspacek.cz/zmena-url-a-skryvani-fbclid-pomoci-javascriptu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment