Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
See: #1093
  • Loading branch information
dteviot committed Oct 14, 2023
1 parent a38587c commit 2b0e472
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions plugin/js/parsers/4kswParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use strict";

parserFactory.register("4ksw.com", () => new _4kswParser());

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

async getChapterUrls(dom) {
let menu = dom.querySelector("ul.list-charts");
return util.hyperlinksToChapterList(menu);
}

findContent(dom) {
return dom.querySelector(".content-body");
}

findChapterTitle(dom) {
return dom.querySelector(".panel-heading").textContent;
}

findCoverImageUrl(dom) {
return util.getFirstImgSrc(dom, ".info1");
}

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

getInformationEpubItemChildNodes(dom) {
return [...dom.querySelectorAll(".info2 div")];
}
}
1 change: 1 addition & 0 deletions plugin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ <h3>Instructions</h3>

<!-- Not used as base -->
<script src="js/parsers/230BookParser.js"></script>
<script src="js/parsers/4kswParser.js"></script>
<script src="js/parsers/69shuParser.js"></script>
<script src="js/parsers/888novelParser.js"></script>
<script src="js/parsers/ActiveTranslationsParser.js"></script>
Expand Down

0 comments on commit 2b0e472

Please sign in to comment.