This morning I clicked on a link in a newsletter from Sun and was presented with a "server not found" error. Odd, especially given I would expect a company of that size to have better QA than that. When I found the same issue with a Software AG newsletter later in the day it was time to investigate.
Turns out this wasn’t a coincidence. Both emails were using links passing through the same tracking server: promo-manager.server-secure.com. I suspected our Corporate firewall was blocking the tracking server, but the content itself would be OK.
Upon inspecting Firefox’s location bar it was obvious that the latter part was an encoded destination URL:
https://promo-manager.server-secure.com/pm/mail/link.php?id=98027102 &link=http%3A%2F%2Fau.sun.com%2Fedge%2F2008%2F02 %2Fentry_level.jsp%3Fcid%3D921839
This is good practice by the web developer but I hate manually trying to decode those things. %3A is ":", %2F is "/", but anything beyond that is a struggle. There had to be an easier way.
I’ve been tinkering with some Javascript recently and it occurred to me a bookmarklet should easily be able to tackle this task. A quick rummage through a language reference and voila - the following bookmarklet was born. Install it by dragging the link onto your toolbar. Use it by opening the bookmarklet when on a page with an encoded URL.
The code isn’t rocket science. It does exactly what I needed.
javascript:location.href=decodeURIComponent(location.href);
After I ran the bookmarklet the location bar contained the following. All I had to do was discard everything prior to the "link=" entry and I was back in business!
https://promo-manager.server-secure.com/pm/mail/link.php?id=98027102 &link=http://au.sun.com/edge/2008/02/entry_level.jsp?cid=921839
Note: The initial URL above is currently working so it would seem our Corporate security guys are getting a little over zealous.
Print This Post




