Skip to content

Commit 1cc6d8e

Browse files
committed
fix
1 parent bc01c81 commit 1cc6d8e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

DownloadAllContent/DownloadAllContent.user.js

Lines changed: 3 additions & 2 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.25
7+
// @version 1.23
88
// @description Fetch and download main content on current page, provide special support for chinese novel
99
// @description:zh-CN 通用网站内容抓取工具,可批量抓取小说、论坛内容等并保存为TXT文档
1010
// @description:zh-TW 通用網站內容抓取工具,可批量抓取小說、論壇內容等並保存為TXT文檔
@@ -121,6 +121,7 @@
121121

122122
function getPageContent(doc){
123123
if(!doc)return i18n.error;
124+
if(doc.defaultView)
124125
[].forEach.call(doc.querySelectorAll("span,div"),function(item){
125126
var thisStyle=doc.defaultView.getComputedStyle(item);
126127
if(thisStyle && (thisStyle.display=="none"||thisStyle.fontSize=="0px"))
@@ -248,7 +249,7 @@
248249
break;
249250
}
250251
}
251-
if(!has && aEle.href && /^http/i.test(aEle.href) && /PART\b|Prologue|-\d+||Chapter\s*\d+|.+[|||||||]|^$|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|[\d|||||||||||||||||-]+(||\.)/i.test(aEle.innerText)){
252+
if(!has && aEle.href && /^http/i.test(aEle.href) && /PART\b|Prologue|-\d+||Chapter\s*\d+|.+[|||||||]|^$|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|[\d|||||||||||||||||-]+(||\.\D)/i.test(aEle.innerText)){
252253
list.push(aEle);
253254
}
254255
}

0 commit comments

Comments
 (0)