From ed93a83a422315ffc6ca4919100bd5e35d7ca696 Mon Sep 17 00:00:00 2001 From: Lucas Pereira Date: Fri, 9 Feb 2024 19:52:39 -0300 Subject: [PATCH] added fanfiction.com.br --- plugin/js/parsers/NyahFanfictionParser.js | 35 + plugin/popup.html | 1361 ++++++++++++++------- 2 files changed, 928 insertions(+), 468 deletions(-) create mode 100644 plugin/js/parsers/NyahFanfictionParser.js diff --git a/plugin/js/parsers/NyahFanfictionParser.js b/plugin/js/parsers/NyahFanfictionParser.js new file mode 100644 index 00000000..28224e7b --- /dev/null +++ b/plugin/js/parsers/NyahFanfictionParser.js @@ -0,0 +1,35 @@ +"use strict"; + +parserFactory.register("fanfiction.com.br", () => new NyahFanfictionParser()); + +class NyahFanfictionParser extends Parser { + constructor() { + super(); + } + + async getChapterUrls(dom) { + let menu = dom.querySelector("div.container_chapter_list"); + return util.hyperlinksToChapterList(menu); + } + + findContent(dom) { + return dom.querySelector("div.historia"); + } + + extractTitleImpl(dom) { + return dom.querySelector("title"); + } + + extractAuthor(dom) { + let authorLabel = dom.querySelector("a.tooltip_userinfo"); + return authorLabel?.textContent ?? super.extractAuthor(dom); + } + + findCoverImageUrl(dom) { + return util.getFirstImgSrc(dom, "div#left_part"); + } + + getInformationEpubItemChildNodes(dom) { + return [...dom.querySelectorAll("p.justify")]; + } +} diff --git a/plugin/popup.html b/plugin/popup.html index d43c80de..46b755c3 100644 --- a/plugin/popup.html +++ b/plugin/popup.html @@ -1,501 +1,925 @@ - + - - + + WebToEpub - - + + - - - + +
- - -
+ + + + + + + + + +
+ +

__MSG_label_Lib_Show_Advanced_Library_Options__

+
+ + +
+ +
+
+ + + + + + + + + + + + + + + +
__MSG_label_Range_Start_Chapter__ + + __MSG_label_Show_Chapter_Urls__
__MSG_label_Range_End_Chapter__
__MSG_label_Chapter_Count__0
+
+ + + + + +
+
+ +
+ __MSG_Searching_For_URLs_Please_Wait__ +
+ + + + + + +
__MSG_column_Include____MSG_column_Title__
+
+ +
+ +
@@ -732,6 +1156,7 @@

Instructions

+ @@ -802,5 +1227,5 @@

Instructions

- +