Skip to content

Commit

Permalink
version 1.5-a2
Browse files Browse the repository at this point in the history
* improved link target retrieval
  • Loading branch information
binfalse committed Jun 26, 2013
1 parent 22b5c8d commit 11c0616
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion chrome/content/yourlsshortener.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,23 @@ var YOURLSshortener = function () {
prefManager.setBoolPref ("extensions.yourls-shortener.askforkey", checked);
return;
},
linkDest : function () {
try {
return gContextMenu.linkURL // new FF, other?
}
catch(e) {
try {
return gContextMenu.linkURL() // old FF, SM, other?
}
catch(e) {
return String(gContextMenu.link) // either FF, other?
}
}
},
run : function (long) {

if (typeof gContextMenu != 'undefined' && gContextMenu.onLink)
long = document.popupNode;
long = this.linkDest ();

if (!long)
{
Expand Down

0 comments on commit 11c0616

Please sign in to comment.