diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index e65d1881b..bfa170f97 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1417,5 +1417,32 @@ Zotero.Utilities = { } } } + }, + + + /** + * Get the real target URL from an intermediate URL + */ + "resolveIntermediateURL":function(url) { + var patterns = [ + // Google search results + { + regexp: /^https?:\/\/(www.)?google\.(com|(com?\.)?[a-z]{2})\/url\?/, + variable: "url" + } + ]; + + for (var i=0, len=patterns.length; i