* 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 = [
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];