Extension Snippet Help? Clean URLs to Remove Tracking

So Ouroboros!

2 Likes

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. :wink:

2 Likes

There are entire science fiction novels based on this concept.

1 Like

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.
1 Like