Plugin Directory

Changeset 1215504


Ignore:
Timestamp:
08/08/2015 08:33:11 AM (11 years ago)
Author:
akrabat
Message:

Add source for bookmarklet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shorter-links/trunk/readme.txt

    r1215501 r1215504  
    4747
    4848(Just drag to your bookmarks bar)
     49
     50The source of the bookmarklet is:
     51
     52    javascript:(function(){var%20url=document.location;var%20links=document.getElementsByTagName('link');var%20found=0;for(var%20i=0,l;l=links[i];i++){if(l.getAttribute('rel')=='shortlink'||(/alternateshort/).exec(l.getAttribute('rel'))){found=l.getAttribute('href');break;}}if(!found){for(var%20i=0;l=document.links[i];i++){if(l.getAttribute('rel')=='shorturl'){found=l.getAttribute('href');break;}}}if(found){prompt('URL:',found);}else{alert("No%20shortlink%20found");}})();
    4953
    5054There's also the "[Short URL](http://github.com/clintecker/Shorturl-Safari-Extension)" Safari extension by Clink Ecker.
Note: See TracChangeset for help on using the changeset viewer.