diff --git a/plugin/js/parsers/WetriedParser.js b/plugin/js/parsers/WetriedParser.js new file mode 100644 index 00000000..540ac7ba --- /dev/null +++ b/plugin/js/parsers/WetriedParser.js @@ -0,0 +1,33 @@ +"use strict"; + +parserFactory.register("wetriedtls.site", function () {return new WetriedParser();}); + +class WetriedParser extends Parser { + constructor() { + super(); + } + + async getChapterUrls(dom) { + return [...dom.querySelectorAll("div[role='tabpanel'] a")] + .map(a => util.hyperLinkToChapter(a)) + .reverse(); + } + + findContent(dom) { + return ( + dom.querySelector("#reader-container") || dom.querySelector("#chapter-content") + ); + } + + extractTitleImpl(dom) { + return dom.querySelector("h1"); + } + + findCoverImageUrl(dom) { + return util.getFirstImgSrc(dom, "div.w-full"); + } + + getInformationEpubItemChildNodes(dom) { + return [...dom.querySelectorAll("div.p-5")]; + } +} diff --git a/plugin/popup.html b/plugin/popup.html index d43c80de..0b01889b 100644 --- a/plugin/popup.html +++ b/plugin/popup.html @@ -779,6 +779,7 @@