X-Git-Url: https://git.ao2.it/GM_direct_download_links.git/blobdiff_plain/9b78a08b8941d4f5ded69bdd5bbbf8d4804dea37..37830ce8da03490964e35e2d2461b3d24ad8f781:/direct_download_links.user.js diff --git a/direct_download_links.user.js b/direct_download_links.user.js index 6d0f401..9b98b37 100644 --- a/direct_download_links.user.js +++ b/direct_download_links.user.js @@ -1,6 +1,6 @@ // direct_download_links - Add direct download links for (video) files -// version 0.1 -// 2011-08-02 +// version 0.2 +// 2011-11-14 // Copyright (C) 2011 Antonio Ospite // Released under the GPL license // http://www.gnu.org/copyleft/gpl.html @@ -33,6 +33,8 @@ * TODO: * - find a way to use the same string as in the @include lines to match the * current window.location + * - use xpath instead of regexp like in http://a32.me/2009/11/greasemonkey/ + * - use jquery, like shown in http://a32.me/2009/11/greasemonkey/ */ var supported_sites = [ @@ -89,13 +91,13 @@ for (i = 0; i < supported_sites.length; i++) { function direct_download_link_add(pageURL, fileElem, fileRegexp, linkDest) { var element = document.getElementById(fileElem); if (!element) { - alert('DirectDL (' + pageURL + '): Cannot find the element containing the file URL.'); + alert('DirectDL (' + pageURL + '): Cannot find the element ' + fileElem + ' containing the file URL.'); return null; } var content = element.textContent; if (!content) { - alert('DirectDL (' + pageURL + '): textContent is null, cannot fild file URL.'); + alert('DirectDL (' + pageURL + '): textContent is null, cannot find file URL.'); } var fileURL = content.match(fileRegexp)[1];