So Ouroboros!
With a little effort, we might even be able to come up with a popclip snippet that, depending on the text highlighted when you invoke the extension, creates a snippet that generates an entirely different extension.
And before long, Popclip will be programming itself.
There are entire science fiction novels based on this concept.
It’s two years after the original post, but I wanted to share an addition I made in case someone else finds it useful. The original extension stripped the tracking code on all sites but left Amazon’s ref: tracking code (it did successfully strip the “?” tracking code…). This revised extension strips both ? and ref: tracking codes. Nick, you may want to check it, but it’s been working for me.
# popclip
name: RemoveREF&Tracking
icon: symbol:circle.slash
requirements: [url]
javascript: popclip.pasteText(popclip.input.text.replace(/(\?.*)$/, '').replace(/(\/dp\/[A-Z0-9]+)(\/|$).*/, '$1'))
description: Remove tracking code and referal code from the selected URL.
(ᵔᵕᵔ)/ love this! Thank you!!! Definitely should be added to the main extensions imo