Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
See: #1541
  • Loading branch information
dteviot committed Oct 6, 2024
1 parent 5bb6597 commit 13559a6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
39 changes: 39 additions & 0 deletions plugin/js/parsers/PowanjuanParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"use strict";

parserFactory.register("powanjuan.cc", () => new PowanjuanParser());

class PowanjuanParser extends Parser{
constructor() {
super();
}

async getChapterUrls(dom) {
let menu = dom.querySelector("div.catalog");
return util.hyperlinksToChapterList(menu);
}

findContent(dom) {
return dom.querySelector("#mycontent");
}

extractTitleImpl(dom) {
return dom.querySelector("h1");
}

extractLanguage() {
return "zh";
}

findChapterTitle(dom) {
return dom.querySelector("h1");
}

async fetchChapter(url) {
let options = { makeTextDecoder: () => new TextDecoder("gb2312") };
return (await HttpClient.wrapFetch(url, options)).responseXML;
}

getInformationEpubItemChildNodes(dom) {
return [...dom.querySelectorAll(".descTip, .descInfo")];
}
}
1 change: 1 addition & 0 deletions plugin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ <h3>Instructions</h3>
<script src="js/parsers/PeachblossomcodexParser.js"></script>
<script src="js/parsers/PeachpittingParser.js"></script>
<script src="js/parsers/PeachpuffParser.js"></script>
<script src="js/parsers/PowanjuanParser.js"></script>
<script src="js/parsers/PtwxzParser.js"></script>
<script src="js/parsers/PuretlParser.js"></script>
<script src="js/parsers/QidianParser.js"></script>
Expand Down

0 comments on commit 13559a6

Please sign in to comment.