projects
/
GM_direct_download_links.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Misc fixes
[GM_direct_download_links.git]
/
direct_download_links.user.js
diff --git
a/direct_download_links.user.js
b/direct_download_links.user.js
index
9b98b37
..
452e2a4
100644
(file)
--- a/
direct_download_links.user.js
+++ b/
direct_download_links.user.js
@@
-95,16
+95,18
@@
function direct_download_link_add(pageURL, fileElem, fileRegexp, linkDest) {
return null;
}
return null;
}
- var content = element.
textContent
;
+ var content = element.
innerHTML
;
if (!content) {
if (!content) {
- alert('DirectDL (' + pageURL + '): textContent is null, cannot find file URL.');
+ alert('DirectDL (' + pageURL + '): content is null, cannot find file URL.');
+ return null;
}
}
- var
fileURL = content.match(fileRegexp)[1]
;
- if (!
fileURL
) {
+ var
matches = content.match(fileRegexp)
;
+ if (!
matches || matches.length < 2 || !matches[1]
) {
alert('DirectDL (' + pageURL + '): file URL not found, check the fileRegexp');
return null;
}
alert('DirectDL (' + pageURL + '): file URL not found, check the fileRegexp');
return null;
}
+ var fileURL = matches[1];
var links = document.getElementById(linkDest);
if (!links) {
var links = document.getElementById(linkDest);
if (!links) {