-
-
Save measureschool/a7d6b3aede48acd1ec05471958510e5e 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
<script> | |
(function () { | |
var links = document.querySelectorAll('a[href*="amazon.com"]') //change amazon.com to any domain you want to target | |
var searchString = ".com/" //the string to be searched forEach | |
var replacementString = ".de/" //the replacement for the searched string | |
links.forEach(function(link){ | |
var original = link.getAttribute("href"); | |
var replace = original.replace(searchString,replacementString) | |
link.setAttribute("href",replace) | |
}) | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment