A delicious bookmarklet that works with noscript

This is technical, so unless you’re a do-it-yourself programming/javascript geek, you will not find it interesting.

I was trying to solve this problem:

  • I like to bookmark interesting links on my delicious.com account
  • I like to use NoScript with my firefox – this disables javascript/flash/ads/XSS and other things on a lot of sites, giving me a much more stable experience on various websites.

Unfortunately, both of these things don’t really go well together. NoScript blocks the delicious bookmarklet, and at this time there doesn’t seem to be a any easy way to get it to work as it is.

I tried adding https://delicious\.com/save to the Anti-XSS Protection Exceptions in NoScript preferences but that did not help.

Of course, I can always copy the URL of the site, go to delicious.com and then add the link manually, but that is too much effort. I do this often enough that I needed to automate the process.

After some trial-and-error I decided that the problem was the use of iframes in the delicious bookmarklet. So I wrote this much simplified delicious bookmarklet which works like a charm.

Here is the code for the bookmarklet:

javascript:window.location='https://delicious.com/save?url='+encodeURIComponent(window.location.href)+"&title="+encodeURIComponent(window.document.title)+"&v=1.1";

Just add a bookmark to your Bookmarks Toolbar with “Add to Delicious” as the name and the above code as the location. Now on any website, click on “Add to Delicious” and you get redirected to a page that prompts you for the tags and will then add the delicious bookmark.

Note: if you want to automatically include the current selection as the note/description in the bookmark, use this code instead (I haven’t tested it, since I’m not interested in a note, but I think it should work):

javascript:window.location='https://delicious.com/save?url='+encodeURIComponent(window.location.href)+"&title="+encodeURIComponent(window.document.title)+"&note="+encodeURIComponent(""+(window.getSelection?window.getSelection():window.document.getSelection?window.document.getSelection():window.document.selection.createRange().text))+"&v=1.1";