Skip to content

Commit 9284126

Browse files
committed
fix
1 parent cf2962f commit 9284126

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

DownloadAllContent/DownloadAllContent.user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @name:zh-TW 懶人小説下載器
55
// @name:ja 怠惰者小説ダウンロードツール
66
// @namespace hoothin
7-
// @version 1.0
7+
// @version 1.01
88
// @description Fetch and download main content on current page
99
// @description:zh-CN 通用网站内容抓取工具,可批量抓取小说、论坛内容等并保存为TXT文档
1010
// @description:zh-TW 通用網站內容抓取工具,可批量抓取小說、論壇內容等並保存為TXT文檔
@@ -104,7 +104,7 @@
104104
var i,j,rStr="",pageData=(doc.body?doc.body:doc).cloneNode(true),delList=[];
105105
[].forEach.call(pageData.querySelectorAll("script,style,link"),function(item){delList.push(item);});
106106
[].forEach.call(delList,function(item){item.parentNode.removeChild(item);});
107-
var largestContent,contents=pageData.querySelectorAll("span,div,article,p,td,strong,font");
107+
var largestContent,contents=pageData.querySelectorAll("span,div,article,p,td");
108108
for(i=0;i<contents.length;i++){
109109
let content=contents[i],hasText=false;
110110
[].forEach.call(content.childNodes,function(item){
@@ -120,9 +120,9 @@
120120
}
121121
}
122122
if(content.firstChild && (
123-
(content.firstChild.nodeType!=3 && !/^(I|A|STRONG|FONT|BR)$/.test(content.firstChild.tagName)) ||
123+
(content.firstChild.nodeType!=3 && !/^(I|A|STRONG|B|FONT|BR)$/.test(content.firstChild.tagName)) ||
124124
(content.firstChild.nodeType==3 && /^\s*$/.test(content.firstChild.data) &&
125-
(!content.childNodes[1] || !(content.childNodes[1].nodeType==3 || /^(I|A|STRONG|FONT|BR)$/.test(content.childNodes[1].tagName))))
125+
(!content.childNodes[1] || !(content.childNodes[1].nodeType==3 || /^(I|A|STRONG|B|FONT|BR)$/.test(content.childNodes[1].tagName))))
126126
))
127127
continue;
128128
if(pageData==document && content.offsetWidth<=0 && content.offsetHeight<=0)

0 commit comments

Comments
 (0)