Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4 from lifegpc/dev
Browse files Browse the repository at this point in the history
update to v1.0.4
  • Loading branch information
lifegpc authored Feb 19, 2020
2 parents 80c0b82 + b74322f commit e5414ff
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 14 deletions.
23 changes: 16 additions & 7 deletions js(origin)/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>} 分类*/
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<string>} 分类*/
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;
Expand All @@ -52,8 +60,9 @@ 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<string>} 分类*/
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} 最新章节链接*/
Expand Down
2 changes: 1 addition & 1 deletion js(origin)/free.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ 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;//作者名
bo.fl=cm.children[3].innerText;//分类
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;
Expand Down
42 changes: 39 additions & 3 deletions js(origin)/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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=['关闭',"开启"];
Expand Down Expand Up @@ -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('作品状态:'));
Expand Down Expand Up @@ -1345,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 当前标签页数组
Expand Down
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version":2,
"name":"起点下载器",
"version":"1.0.3",
"version":"1.0.4",
"description":"下载起点中文网/纵横中文网上的小说。已在github上开源,项目链接:https://github.com/lifegpc/qdbookdownload",
"icons":
{
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit e5414ff

Please sign in to comment.