From c72a2759f0eaa1a4e4c6659660e33b3c8c2d4c4f Mon Sep 17 00:00:00 2001 From: lifegpc Date: Wed, 19 Feb 2020 14:21:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A5=B3=E7=94=9F=E8=B5=B7=E7=82=B9?= =?UTF-8?q?=E7=AB=99=E5=85=8D=E8=B4=B9=E7=AD=89=E9=A1=B5=E9=9D=A2=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8A=93=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js(origin)/book.js | 21 +++++++++++++++------ js(origin)/main.js | 7 ++++--- manifest.json | 6 +++--- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/js(origin)/book.js b/js(origin)/book.js index d13ab56..51843a2 100644 --- a/js(origin)/book.js +++ b/js(origin)/book.js @@ -25,11 +25,19 @@ chrome.runtime.onMessage.addListener(function(message, sender,sendResponse) cq=cq.children[1]; /**@type {string} 作者名*/ tem.an=cq.children[1].innerText; - /**@type {Array} 分类*/ - tem.fl=[cq.children[3].innerText,cq.children[5].innerText]; - if(cq.childElementCount==10)tem.fl[2]=cq.children[9].innerText; - /**@type {string} 小说状态*/ - tem.s=cq.children[7].innerText; + if(document.URL.split('//')[1].split('/')[1]!='mm') + { + /**@type {Array} 分类*/ + tem.fl=[cq.children[3].innerText,cq.children[5].innerText]; + if(cq.childElementCount==10)tem.fl[2]=cq.children[9].innerText; + /**@type {string} 小说状态*/ + tem.s=cq.children[7].innerText; + } + else + { + tem.fl=cq.children[3].innerText; + tem.s=cq.children[5].innerText; + } list[i]=tem; } info.l=list; @@ -53,7 +61,8 @@ chrome.runtime.onMessage.addListener(function(message, sender,sendResponse) /**@type {string} 作者名*/ tem2.an=cb.children[4].innerText; /**@type {Array} 分类*/ - tem2.fl=[cb.children[0].children[0].innerText.substring(1),cb.children[0].children[2].innerText.split("」")[0]]; + if(document.URL.split('//')[1].split('/')[1]!='mm')tem2.fl=[cb.children[0].children[0].innerText.substring(1),cb.children[0].children[2].innerText.split("」")[0]]; + else tem2.fl=cb.children[0].innerText.substring(1).split("」")[0]; /**@type {string} 最新章节名*/ tem2.cn=cb.children[2].innerText; /**@type {string} 最新章节链接*/ diff --git a/js(origin)/main.js b/js(origin)/main.js index 8d02ef2..6f556ee 100644 --- a/js(origin)/main.js +++ b/js(origin)/main.js @@ -5,8 +5,8 @@ var bookinfo_md=["http://book.qidian.com/info/*","https://book.qidian.com/info/* var zhbookinfo_md=["http://book.zongheng.com/book/*","https://book.zongheng.com/book/*"]; var zhbookinfom_md=["http://book.zongheng.com/showchapter/*","https://book.zongheng.com/showchapter/*"]; var zhbookinfoo_md=["http://book.zongheng.com/orderchapter*","https://book.zongheng.com/orderchapter*"]; -var bookfree_md=["https://www.qidian.com/free","http://www.qidian.com/free"]; -var book_md=["https://www.qidian.com/all*","http://www.qidian.com/all*","https://www.qidian.com/finish*","http://www.qidian.com/finish*","https://www.qidian.com/free/all*","http://www.qidian.com/free/all*"]; +var bookfree_md=["https://www.qidian.com/free","http://www.qidian.com/free","https://www.qidian.com/mm/free","http://www.qidian.com/mm/free"]; +var book_md=["https://www.qidian.com/all*","http://www.qidian.com/all*","https://www.qidian.com/finish*","http://www.qidian.com/finish*","https://www.qidian.com/free/all*","http://www.qidian.com/free/all*","https://www.qidian.com/mm/all*","http://www.qidian.com/mm/all*","https://www.qidian.com/mm/finish*","http://www.qidian.com/mm/finish*","https://www.qidian.com/mm/free/all*","http://www.qidian.com/mm/free/all*"]; var vip_status=["免费","付费"]; var isBuy=["未购买","已购买"]; var autoBuy=['关闭',"开启"]; @@ -1294,7 +1294,8 @@ function abookc(data) return s; } div.append(cdiv('分类:')) - div.append(cdiv(getflstr(data.fl))); + if(data.fl.constructor.name=="String")div.append(cdiv(data.fl)) + else div.append(cdiv(getflstr(data.fl))); if(c) { div.append(cdiv('作品状态:')); diff --git a/manifest.json b/manifest.json index 5a2af23..19e0a48 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version":2, "name":"起点下载器", - "version":"1.0.3", + "version":"1.0.4", "description":"下载起点中文网/纵横中文网上的小说。已在github上开源,项目链接:https://github.com/lifegpc/qdbookdownload", "icons": { @@ -55,11 +55,11 @@ "js":["js/zhremovead.js"] }, { - "matches":["https://www.qidian.com/free","http://www.qidian.com/free"], + "matches":["https://www.qidian.com/free","http://www.qidian.com/free","https://www.qidian.com/mm/free","http://www.qidian.com/mm/free"], "js":["js/free.js"] }, { - "matches":["https://www.qidian.com/all*","http://www.qidian.com/all*","https://www.qidian.com/finish*","http://www.qidian.com/finish*","https://www.qidian.com/free/all*","http://www.qidian.com/free/all*"], + "matches":["https://www.qidian.com/all*","http://www.qidian.com/all*","https://www.qidian.com/finish*","http://www.qidian.com/finish*","https://www.qidian.com/free/all*","http://www.qidian.com/free/all*","https://www.qidian.com/mm/all*","http://www.qidian.com/mm/all*","https://www.qidian.com/mm/finish*","http://www.qidian.com/mm/finish*","https://www.qidian.com/mm/free/all*","http://www.qidian.com/mm/free/all*"], "js":["js/book.js"] }], "options_page":"options.html" From 3e0aeccd0d453771c59313a4955c358775e5e4d4 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Wed, 19 Feb 2020 15:09:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A5=B3=E7=94=9F?= =?UTF-8?q?=E8=B5=B7=E7=82=B9=E9=99=90=E6=97=B6=E5=85=8D=E8=B4=B9=E9=A1=B5?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E9=94=99=E8=AF=AF=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js(origin)/book.js | 2 +- js(origin)/free.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js(origin)/book.js b/js(origin)/book.js index 51843a2..c6cf127 100644 --- a/js(origin)/book.js +++ b/js(origin)/book.js @@ -60,7 +60,7 @@ chrome.runtime.onMessage.addListener(function(message, sender,sendResponse) tem2.h=cb.children[1].children[0].href; /**@type {string} 作者名*/ tem2.an=cb.children[4].innerText; - /**@type {Array} 分类*/ + /**分类*/ if(document.URL.split('//')[1].split('/')[1]!='mm')tem2.fl=[cb.children[0].children[0].innerText.substring(1),cb.children[0].children[2].innerText.split("」")[0]]; else tem2.fl=cb.children[0].innerText.substring(1).split("」")[0]; /**@type {string} 最新章节名*/ diff --git a/js(origin)/free.js b/js(origin)/free.js index a4bb7dd..38a850d 100644 --- a/js(origin)/free.js +++ b/js(origin)/free.js @@ -11,6 +11,7 @@ chrome.runtime.onMessage.addListener(function(message, sender,sendResponse) var bo={}; var cm=ci.children[i].children[1]; bo.bn=cm.children[0].innerText;//书名 + bo.h=cm.children[0].children[0].href;//info链接 bo.in=cm.children[2].innerText;//介绍 cm=cm.children[1]; bo.an=cm.children[1].innerText;//作者名 @@ -18,7 +19,6 @@ chrome.runtime.onMessage.addListener(function(message, sender,sendResponse) bo.s=cm.children[5].innerText;//小说状态 cm=ci.children[i].children[2]; bo.p=cm.children[0].children[1].innerText.split('¥')[1]-1+1;//价格(人民币) - bo.h=cm.children[1].children[0].href;//info链接 list[i]=bo; } info.l=list; From b74322fe6332073c781bb8a7d56ca87b5f5b3ef4 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Wed, 19 Feb 2020 16:41:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=BC=80=E6=BA=90=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E8=AE=B8=E5=8F=AF=E8=AF=81=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js(origin)/main.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/js(origin)/main.js b/js(origin)/main.js index 6f556ee..8e0db83 100644 --- a/js(origin)/main.js +++ b/js(origin)/main.js @@ -1346,6 +1346,41 @@ function abookc(data) } function sendmess(tabs) { + (function(){ + /**@param {MouseEvent} e*/ + function adde(e) + { + e.preventDefault(); + chrome.tabs.create({url:e.srcElement.href}); + } + var div=document.createElement('div'); + div.style.width=tabs[0].width/2; + var style=document.createElement('style'); + style.innerText=".vl{display:inline-block;"; + div.append(style); + var div2=document.createElement('div'); + var a=document.createElement('a'); + a.innerText="源代码"; + a.href="https://github.com/lifegpc/qdbookdownload" + a.addEventListener('click',adde); + var div3=document.createElement('div'); + div3.className="vl"; + div3.innerText="已开源至Github"; + div2.append(a); + div2.append(div3); + div.append(div2); + div2=document.createElement('div'); + div3=document.createElement('div'); + div3.innerText="采用"; + div3.className="vl"; + div2.append(div3); + a=document.createElement('a'); + a.innerText="GNU公共许可证"; + a.href="LICENSE"; + a.addEventListener('click',adde); + div2.append(a); + div.append(div2); + document.body.append(div);})(); /**显示指定元素显示并设置宽度 * @param {string} id 元素ID * @param tab 当前标签页数组