diff --git a/plugin/js/parsers/Ffxs8Parser.js b/plugin/js/parsers/Ffxs8Parser.js new file mode 100644 index 00000000..6b5255e7 --- /dev/null +++ b/plugin/js/parsers/Ffxs8Parser.js @@ -0,0 +1,40 @@ +"use strict"; + +parserFactory.register("ffxs8.com", () => new Ffxs8Parser()); + +class Ffxs8Parser extends Parser{ + constructor() { + super(); + } + + async getChapterUrls(dom) { + let menu = dom.querySelector("div.catalog"); + return util.hyperlinksToChapterList(menu); + } + + findContent(dom) { + return dom.querySelector("div.content"); + } + + findChapterTitle(dom) { + return dom.querySelector("div.article h1"); + } + + findCoverImageUrl(dom) { + return util.getFirstImgSrc(dom, "div.cover"); + } + + async fetchChapter(url) { + return (await HttpClient.wrapFetch(url, this.makeOptions())).responseXML; + } + + makeOptions() { + return ({ + makeTextDecoder: () => new TextDecoder("gb2312") + }); + } + + getInformationEpubItemChildNodes(dom) { + return [...dom.querySelectorAll("div.descInfo")]; + } +} diff --git a/plugin/popup.html b/plugin/popup.html index 785632c6..60482dd9 100644 --- a/plugin/popup.html +++ b/plugin/popup.html @@ -569,6 +569,7 @@