I absolutely love the new Extension Snippets! Such a cool, elegant implementation.
I was trying to modify the Remove Dots Extension Snippet to make it remove the tracking info from URLs (basically everything from and including ?):
BEFORE:
https://www.nytimes.com/guides/gifts/2021-holiday-gift-guide?campaign_id=190&emc=edit_ufn_20211120&instance_id=45940&nl=updates-from-the-newsroom
AFTER:
https://www.nytimes.com/guides/gifts/2021-holiday-gift-guide
Here’s what I came up with (that doesn’t work). I tried to just change the regex. Clearly, I don’t know Javascript:
# popclip
name: Remove Tracking
javascript: popclip.pasteText(popclip.input.text.replace(/([^\?]*)/))
description: Remove tracking code from the selected URL.
I’d be grateful if anyone could show me what’s wrong with the above snippet.
Thanks in advance!