From 30ecf45512e00fefce4f59130a9009e5bb277156 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sampara Date: Tue, 18 Mar 2025 16:34:37 +0530 Subject: [PATCH 001/123] Changes to be committed: modified: plugin/js/EpubMetaInfo.js modified: plugin/js/parsers/ComrademaoParser.js modified: plugin/js/parsers/CreativeNovelsParser.js modified: plugin/js/parsers/FoxaholicParser.js modified: plugin/js/parsers/ManganovParser.js modified: plugin/js/parsers/PandaNovelParser.js modified: plugin/js/parsers/ShmtranslationsParser.js modified: plugin/js/parsers/WordpressBaseParser.js modified: plugin/js/parsers/WuxiaworldParser.js modified: plugin/popup.html --- plugin/js/EpubMetaInfo.js | 44 +++++++++++++++++----- plugin/js/parsers/ComrademaoParser.js | 6 +-- plugin/js/parsers/CreativeNovelsParser.js | 2 +- plugin/js/parsers/FoxaholicParser.js | 5 +++ plugin/js/parsers/ManganovParser.js | 4 ++ plugin/js/parsers/PandaNovelParser.js | 2 +- plugin/js/parsers/ShmtranslationsParser.js | 2 +- plugin/js/parsers/WordpressBaseParser.js | 9 ++++- plugin/js/parsers/WuxiaworldParser.js | 2 +- plugin/popup.html | 22 ++++++----- 10 files changed, 71 insertions(+), 27 deletions(-) diff --git a/plugin/js/EpubMetaInfo.js b/plugin/js/EpubMetaInfo.js index 70d362342..25e625b51 100644 --- a/plugin/js/EpubMetaInfo.js +++ b/plugin/js/EpubMetaInfo.js @@ -72,20 +72,36 @@ class EpubMetaInfo { "}\r"+ "body {\r"+ - " margin: 2%;\r"+ + " margin: 2%;\r"+ "}\r"+ //Breaks extremely long words, screams, wails etc to fit viewer window. "p {\r"+ - " overflow-wrap: break-word;\r"+ + " overflow-wrap: break-word;\r"+ + "}\r"+ + + //First letter of first start paragraph with

tag. + "p:first-letter {\r"+ + " text-transform: uppercase;\r"+ + "}\r"+ + + "h1 + p:first-letter, h3 + p:first-letter, h2 + p:first-letter {\r"+ + " font-size: 2em;\r"+ + " font-weight: bold;\r"+ + " text-shadow: 0 1px 2px rgba(255, 223, 97, 1), 1px 2px 3px black;\r"+ + " text-transform: uppercase;\r"+ + "}\r"+ + + "h1 + p, h3 + p, h2 + p {\r"+ + " text-indent: 0.12em;\r"+ "}\r"+ // Prevent texts inside mutliple definition list tags going outside viewer window. // Example https://www.baka-tsuki.org/project/index.php?title=The_Unexplored_Summon_Blood_Sign:Volume2_Opening2 // It looks okay in a browser but in devices with small screen, it's almost unreadable. "dd, dt, dl {\r"+ - " padding: 0;\r"+ - " margin: 0;\r"+ + " padding: 0;\r"+ + " margin: 0;\r"+ "}\r"+ "img {\r"+ @@ -113,10 +129,10 @@ class EpubMetaInfo { // differentiate caption text from body text ".thumbcaption {\r"+ - " display: block;\r"+ - " font-size: 0.9em;\r"+ - " padding-right: 5%;\r"+ - " padding-left: 5%;\r"+ + " display: block;\r"+ + " font-size: 0.9em;\r"+ + " padding-right: 5%;\r"+ + " padding-left: 5%;\r"+ "}\r"+ // To make hr tags more visible. BT doesn't use them very often but other sites might. @@ -139,6 +155,16 @@ class EpubMetaInfo { "}\r"+ "a:active {\r"+ " text-decoration: underline;\r"+ + "}\r"+ + + // red link for BT non-existent page // + "a.new {\r"+ + " color: #ba0000;\r"+ + "}\r"+ + + // some groups use

 tag for character status with no wrapping, thus breaking the view in ebook //
+        "pre {\r"+
+        "   white-space: pre-wrap;\r"+
         "}"+
 
         "table {\r"+
@@ -151,7 +177,7 @@ class EpubMetaInfo {
 
         // Box around author notes
         ".webToEpub-author-note {\r" +
-        "    border: 1px solid black; padding: 0.5em\r" +
+        "   border: 1px solid black; padding: 0.5em\r" +
         "}";
     }
 
diff --git a/plugin/js/parsers/ComrademaoParser.js b/plugin/js/parsers/ComrademaoParser.js
index 9e65d6723..73f17a0b0 100644
--- a/plugin/js/parsers/ComrademaoParser.js
+++ b/plugin/js/parsers/ComrademaoParser.js
@@ -8,9 +8,9 @@ class ComrademaoParser extends Parser{
         super();
     }
 
-    disabled() {
-        return chrome.i18n.getMessage("warningParserDisabledComradeMao");
-    }
+    // disabled() {
+    //     return chrome.i18n.getMessage("warningParserDisabledComradeMao");
+    // }
 
     // This site can't handle more than 1 page at a time
     clampSimultanousFetchSize() {
diff --git a/plugin/js/parsers/CreativeNovelsParser.js b/plugin/js/parsers/CreativeNovelsParser.js
index 6c43a6017..f0706f1f8 100644
--- a/plugin/js/parsers/CreativeNovelsParser.js
+++ b/plugin/js/parsers/CreativeNovelsParser.js
@@ -16,7 +16,7 @@ class CreativeNovelsParser extends Parser{
 
     removeUnwantedElementsFromContentElement(element) {
         util.removeElements(element.querySelectorAll("div.team, div.x-donate-1,"+
-            " div.navigation, div.navi, header.entry-header"));
+            " div.navigation, div.navi, header.entry-header, .support-placement"));
         super.removeUnwantedElementsFromContentElement(element);
     }
 
diff --git a/plugin/js/parsers/FoxaholicParser.js b/plugin/js/parsers/FoxaholicParser.js
index fdf0940a2..ba5c83b4b 100644
--- a/plugin/js/parsers/FoxaholicParser.js
+++ b/plugin/js/parsers/FoxaholicParser.js
@@ -28,6 +28,11 @@ class FoxaholicParser extends WordpressBaseParser{
             : title.textContent;
     }
 
+    removeUnwantedElementsFromContentElement(element) {
+        util.removeChildElementsMatchingCss(element, "div.foxaholic-publift-manga-chapter");
+        super.removeUnwantedElementsFromContentElement(element);
+    }
+
     findCoverImageUrl(dom) {
         return util.getFirstImgSrc(dom, "div.summary_image");
     }
diff --git a/plugin/js/parsers/ManganovParser.js b/plugin/js/parsers/ManganovParser.js
index dc9a5c270..7637d1a14 100644
--- a/plugin/js/parsers/ManganovParser.js
+++ b/plugin/js/parsers/ManganovParser.js
@@ -37,4 +37,8 @@ class ManganovParser extends Parser{
     getInformationEpubItemChildNodes(dom) {
         return [...dom.querySelectorAll("section.mb-3.mt-2  p")];
     }
+
+    removeUnwantedElementsFromContentElement(content) {
+        util.removeChildElementsMatchingCss(content, "small.text-muted, p.text-center.mb-0");
+    }
 }
diff --git a/plugin/js/parsers/PandaNovelParser.js b/plugin/js/parsers/PandaNovelParser.js
index 23fef368e..be24c440b 100644
--- a/plugin/js/parsers/PandaNovelParser.js
+++ b/plugin/js/parsers/PandaNovelParser.js
@@ -97,7 +97,7 @@ class PandaNovelParser extends Parser {
     }
 
     removeUnwantedElementsFromContentElement(element) {
-        util.removeChildElementsMatchingCss(element, ".novel-ins, sub");
+        util.removeChildElementsMatchingCss(element, ".novel-ins, sub, del");
         super.removeUnwantedElementsFromContentElement(element);
     }
 
diff --git a/plugin/js/parsers/ShmtranslationsParser.js b/plugin/js/parsers/ShmtranslationsParser.js
index f0f267581..22e2b07f1 100644
--- a/plugin/js/parsers/ShmtranslationsParser.js
+++ b/plugin/js/parsers/ShmtranslationsParser.js
@@ -22,7 +22,7 @@ class ShmtranslationsParser extends WordpressBaseParser{
     };
 
     findChapterTitle(dom) {
-        return dom.querySelector(".entry-title");
+        return dom.querySelector(".wp-block-post-title");
     }
 
     static cleanLaterContent(content) {
diff --git a/plugin/js/parsers/WordpressBaseParser.js b/plugin/js/parsers/WordpressBaseParser.js
index b6dff194e..016b5a9d6 100644
--- a/plugin/js/parsers/WordpressBaseParser.js
+++ b/plugin/js/parsers/WordpressBaseParser.js
@@ -4,6 +4,7 @@
 "use strict";
 
 parserFactory.register("bakapervert.wordpress.com", function() { return new WordpressBaseParser() });
+parserFactory.register("wujizun.com", function() { return new WordpressBaseParser() });
 parserFactory.register("crimsonmagic.me", function() { return new WordpressBaseParser() });
 parserFactory.register("shalvationtranslations.wordpress.com", function() { return new WordpressBaseParser() });
 parserFactory.register("frostfire10.wordpress.com", function() { return new WordpressBaseParser() });
@@ -57,7 +58,13 @@ class WordpressBaseParser extends Parser {
     findParentNodeOfChapterLinkToRemoveAt(link) {
         // "next" and "previous" chapter links may be inside  then 

tag let toRemove = util.moveIfParent(link, "strong"); - return util.moveIfParent(toRemove, "p"); + return util.moveIfParent(toRemove, "p") || + util.moveIfParent(toRemove, "span"); + } + + removeUnwantedElementsFromContentElement(element) { + util.removeChildElementsMatchingCss(element, "div.cb_p6_patreon_button, div.jp-relatedposts, .cbxwpbkmarkwrap"); + super.removeUnwantedElementsFromContentElement(element); } static findChapterTitleElement(dom) { diff --git a/plugin/js/parsers/WuxiaworldParser.js b/plugin/js/parsers/WuxiaworldParser.js index de83e6b2e..a39b9e218 100644 --- a/plugin/js/parsers/WuxiaworldParser.js +++ b/plugin/js/parsers/WuxiaworldParser.js @@ -77,7 +77,7 @@ class WuxiaworldParser extends Parser { cleanContent(content) { - util.removeChildElementsMatchingCss(content, "button, #spoiler_teaser"); + util.removeChildElementsMatchingCss(content, "button, #spoiler_teaser, .chapter-nav"); let toDelete = [...content.querySelectorAll("a")] .filter(a => a.textContent === "Teaser"); util.removeElements(toDelete); diff --git a/plugin/popup.html b/plugin/popup.html index 5b2709931..075bd7311 100644 --- a/plugin/popup.html +++ b/plugin/popup.html @@ -253,7 +253,7 @@

Instructions

- + __MSG_label_no_additional_metadata__ @@ -261,7 +261,7 @@

Instructions

__MSG_label_auto_search_metadata__ - + __MSG_label_less_tags__ @@ -306,11 +306,11 @@

Instructions

- + __MSG_label_Skip_Images__ - + __MSG_label_Include_URL_of_Images__ @@ -322,7 +322,7 @@

Instructions

__MSG_label_Remove_Superscript_From_Alternate_Translations__ - + __MSG_label_Use_SVG_for_Images__ @@ -340,19 +340,19 @@

Instructions

- + __MSG_label_No_Download_Popup__ - + __MSG_label_Write_Error_History_To_File__ - + __MSG_label_Create_Epub_3__ - + __MSG_label_Use_Full_Title_As_File_Name__ @@ -379,12 +379,14 @@

Instructions

+