From ca221c9df19521b05019112f2f161d21bc6e9ecf Mon Sep 17 00:00:00 2001 From: Leone Jacob Sunil <109210868+ImLJS@users.noreply.github.com> Date: Tue, 20 Feb 2024 08:38:33 +0530 Subject: [PATCH] Add site wetried.site --- plugin/js/parsers/WetriedParser.js | 33 ++++++++++++++++++++++++++++++ plugin/popup.html | 1 + 2 files changed, 34 insertions(+) create mode 100644 plugin/js/parsers/WetriedParser.js 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 @@