Skip to content

Commit 6ec5d79

Browse files
committed
Update DownloadAllContent.user.js
1 parent 26adbd0 commit 6ec5d79

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

DownloadAllContent/DownloadAllContent.user.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @name:zh-TW 怠惰小説下載器
55
// @name:ja 怠惰者小説ダウンロードツール
66
// @namespace hoothin
7-
// @version 2.8.3.13
7+
// @version 2.8.3.14
88
// @description Lightweight web scraping script. Fetch and download main textual content from the current page, provide special support for novels
99
// @description:zh-CN 通用网站内容爬虫抓取工具,可批量抓取任意站点的小说、论坛内容等并保存为TXT文档
1010
// @description:zh-TW 通用網站內容爬蟲抓取工具,可批量抓取任意站點的小說、論壇內容等並保存為TXT文檔
@@ -1830,6 +1830,17 @@ if (window.top != window.self) {
18301830
if(evalCode.indexOf("return ")==-1){
18311831
if(evalCode.indexOf("@")==0){
18321832
let content="";
1833+
var selectors=GM_getValue("selectors");
1834+
if(selectors){
1835+
[].forEach.call(data.querySelectorAll(selectors),function(item){
1836+
item.innerHTML="";
1837+
});
1838+
}
1839+
[].forEach.call(data.querySelectorAll("script,style,link,noscript,iframe"),function(item){
1840+
if (item && item.parentNode) {
1841+
item.parentNode.removeChild(item);
1842+
}
1843+
});
18331844
if(retainImage){
18341845
[].forEach.call(data.querySelectorAll("img[src]"), img => {
18351846
let imgTxt=`![img](${canonicalUri(img.getAttribute("src"), location.href)})`;

0 commit comments

Comments
 (0)