Skip to content

Commit 57a9880

Browse files
committed
fix
1 parent 3c0b61e commit 57a9880

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

DownloadAllContent/DownloadAllContent.user.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
};
4848
break;
4949
}
50+
var firefox=navigator.userAgent.toLowerCase().indexOf('firefox')!=-1;
5051

5152
function indexDownload(aEles){
5253
var rocketContent=document.createElement("div");
@@ -150,14 +151,14 @@
150151
allSingle=false;
151152
}
152153
if(allSingle){
153-
curNum=(navigator.userAgent.toLowerCase().indexOf('firefox')==-1?content.innerText.length:content.textContent.length);
154+
curNum=(firefox?content.textContent.length:content.innerText.length);
154155
}else {
155156
if(!hasText)continue;
156157
if(pageData==document && content.offsetWidth<=0 && content.offsetHeight<=0)
157158
continue;
158159
[].forEach.call(content.childNodes,function(item){
159-
if(item.nodeType==3)
160-
curNum+=item.data.length;
160+
if(item.nodeType==3)curNum+=item.data.length;
161+
else if(/^(I|A|STRONG|B|FONT)$/.test(item.tagName))curNum+=(firefox?item.textContent.length:item.innerText.length);
161162
});
162163
}
163164
if(curNum>largestNum){

0 commit comments

Comments
 (0)