From 11c061686b4981f72c942d82d36fbedf61b84dbf Mon Sep 17 00:00:00 2001 From: Martin Scharm Date: Wed, 26 Jun 2013 20:09:20 +0200 Subject: [PATCH] version 1.5-a2 * improved link target retrieval --- chrome/content/yourlsshortener.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/chrome/content/yourlsshortener.js b/chrome/content/yourlsshortener.js index ffcc357..55fe741 100644 --- a/chrome/content/yourlsshortener.js +++ b/chrome/content/yourlsshortener.js @@ -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) {