Created
December 10, 2018 09:55
-
-
Save measureschool/75e91074d3bad83c85fcb4c7880af565 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 attachmentString = "" //the string to be attached to the end of the link | |
links.forEach(function(link){ | |
var original = link.getAttribute("href"); | |
link.setAttribute("href",original+attachmentString) | |
}) | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you for this.