From 59a4132cece95c24321730b4743063017a2b5d28 Mon Sep 17 00:00:00 2001 From: nothing0074 <88822838+nothing0074@users.noreply.github.com> Date: Sat, 27 Dec 2025 19:19:32 +0000 Subject: [PATCH 01/10] Add TruyenFullVisionParser script to popup.html --- plugin/popup.html | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/popup.html b/plugin/popup.html index a3039cf1..bb2f4ba1 100644 --- a/plugin/popup.html +++ b/plugin/popup.html @@ -903,6 +903,7 @@

Instructions

+ From 9711f2cca2d554b4c593bb6ea568fda218d24a52 Mon Sep 17 00:00:00 2001 From: nothing0074 <88822838+nothing0074@users.noreply.github.com> Date: Sat, 27 Dec 2025 19:20:09 +0000 Subject: [PATCH 02/10] Add files via upload --- plugin/js/parsers/TruyenFullVisionParser.js | 71 +++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 plugin/js/parsers/TruyenFullVisionParser.js diff --git a/plugin/js/parsers/TruyenFullVisionParser.js b/plugin/js/parsers/TruyenFullVisionParser.js new file mode 100644 index 00000000..49687f0f --- /dev/null +++ b/plugin/js/parsers/TruyenFullVisionParser.js @@ -0,0 +1,71 @@ +"use strict"; +parserFactory.register("truyenfull.vision", () => new TruyenFullVisionParser()); + +class TruyenFullVisionParser extends Parser { + constructor() { + super(); + } + + getChapterUrls(dom, chapterUrlsUI) { + return this.getChapterUrlsFromMultipleTocPages(dom, + TruyenFullVisionParser.extractPartialChapterList, + TruyenFullVisionParser.getUrlsOfTocPages, + chapterUrlsUI + ); + } + + static getUrlsOfTocPages(dom) { + let urls = []; + let input = dom.querySelector("input#total-page"); + console.log("Total page input found:", input); + if (input != null) { + let totalp = parseInt(input.getAttribute("value")); + console.log("Total pages:", totalp); + console.log("Base URI:", dom.baseURI); + for (let i = 2; i <= totalp; ++i ) { + urls.push(`${dom.baseURI}trang-${i}/`); + } + } + console.log("Generated ToC URLs:", urls); + return urls; + } + + static extractPartialChapterList(dom) { + return [...dom.querySelectorAll("ul.list-chapter a")] + .map(link => util.hyperLinkToChapter(link)); + } + + + findContent(dom) { + return dom.querySelector("div.chapter-c"); + } + extractTitleImpl(dom) { + return dom.querySelector("h3.title"); + } + + extractAuthor(dom) { + let authorLabel = dom.querySelector("a[itemprop='author']"); + return authorLabel?.textContent ?? super.extractAuthor(dom); + } + + extractLanguage(dom) { + return dom.querySelector("html").getAttribute("lang"); + } + + extractDescription(dom) { + return dom.querySelector(".desc-text").textContent.trim(); + } + + findChapterTitle(dom) { + let title = dom.querySelector("a.chapter-title"); + return (title === null) ? super.findChapterTitle(dom) : title.textContent; + } + + findCoverImageUrl(dom) { + return util.getFirstImgSrc(dom, "div.book"); + } + + getInformationEpubItemChildNodes(dom) { + return [...dom.querySelectorAll("div.desc-text")]; + } +} From 0989944014f6cf20c41be22ec525a966c8244e15 Mon Sep 17 00:00:00 2001 From: nothing0074 <88822838+nothing0074@users.noreply.github.com> Date: Sat, 27 Dec 2025 19:21:20 +0000 Subject: [PATCH 03/10] Refactor TruyenFullVisionParser URL generation logic Updated getUrlsOfTocPages method to improve URL generation logic and handle base path correctly. --- plugin/js/parsers/TruyenFullVisionParser.js | 34 ++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/plugin/js/parsers/TruyenFullVisionParser.js b/plugin/js/parsers/TruyenFullVisionParser.js index 49687f0f..e560790b 100644 --- a/plugin/js/parsers/TruyenFullVisionParser.js +++ b/plugin/js/parsers/TruyenFullVisionParser.js @@ -14,21 +14,27 @@ class TruyenFullVisionParser extends Parser { ); } - static getUrlsOfTocPages(dom) { - let urls = []; - let input = dom.querySelector("input#total-page"); - console.log("Total page input found:", input); - if (input != null) { - let totalp = parseInt(input.getAttribute("value")); - console.log("Total pages:", totalp); - console.log("Base URI:", dom.baseURI); - for (let i = 2; i <= totalp; ++i ) { - urls.push(`${dom.baseURI}trang-${i}/`); - } - } - console.log("Generated ToC URLs:", urls); - return urls; +static getUrlsOfTocPages(dom) { + let urls = []; + let input = dom.querySelector("input#total-page"); + if (!input) return urls; + + let totalp = parseInt(input.getAttribute("value"), 10); + let current = new URL(dom.baseURI); + + // Remove any existing /trang-/ suffix from pathname + let basePath = current.pathname.replace(/\/trang-\d+\/?$/, ''); + if (!basePath.endsWith('/')) basePath += '/'; + + for (let i = 2; i <= totalp; ++i) { + let u = new URL(current); // clone + u.hash = ''; // drop fragment + u.search = ''; // drop query if you don't want it + u.pathname = basePath + `trang-${i}/`; + urls.push(u.toString()); } + return urls; +} static extractPartialChapterList(dom) { return [...dom.querySelectorAll("ul.list-chapter a")] From 43be693c5ae8dbd79562abec22f4fe623f8440e0 Mon Sep 17 00:00:00 2001 From: nothing0074 <88822838+nothing0074@users.noreply.github.com> Date: Sun, 28 Dec 2025 01:58:54 +0000 Subject: [PATCH 04/10] Refactor TruyenFullVisionParser class structure --- plugin/js/parsers/TruyenFullVisionParser.js | 34 ++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/plugin/js/parsers/TruyenFullVisionParser.js b/plugin/js/parsers/TruyenFullVisionParser.js index e560790b..399fc8dd 100644 --- a/plugin/js/parsers/TruyenFullVisionParser.js +++ b/plugin/js/parsers/TruyenFullVisionParser.js @@ -14,27 +14,27 @@ class TruyenFullVisionParser extends Parser { ); } -static getUrlsOfTocPages(dom) { - let urls = []; - let input = dom.querySelector("input#total-page"); - if (!input) return urls; + static getUrlsOfTocPages(dom) { + let urls = []; + let input = dom.querySelector("input#total-page"); + if (!input) return urls; - let totalp = parseInt(input.getAttribute("value"), 10); - let current = new URL(dom.baseURI); + let totalp = parseInt(input.getAttribute("value"), 10); + let current = new URL(dom.baseURI); - // Remove any existing /trang-/ suffix from pathname - let basePath = current.pathname.replace(/\/trang-\d+\/?$/, ''); - if (!basePath.endsWith('/')) basePath += '/'; + // Remove any existing /trang-/ suffix from pathname + let basePath = current.pathname.replace(/\/trang-\d+\/?$/, ""); + if (!basePath.endsWith("/")) basePath += "/"; - for (let i = 2; i <= totalp; ++i) { - let u = new URL(current); // clone - u.hash = ''; // drop fragment - u.search = ''; // drop query if you don't want it - u.pathname = basePath + `trang-${i}/`; - urls.push(u.toString()); + for (let i = 2; i <= totalp; ++i) { + let u = new URL(current); // clone + u.hash = ""; // drop fragment + u.search = ""; // drop query if you don't want it + u.pathname = basePath + `trang-${i}/`; + urls.push(u.toString()); + } + return urls; } - return urls; -} static extractPartialChapterList(dom) { return [...dom.querySelectorAll("ul.list-chapter a")] From 69671f8e8d900c1331bd74c3af080a1aa17f9e76 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 28 Dec 2025 02:51:38 +0000 Subject: [PATCH 05/10] Auto version bump for Version 1.0.10.8 --- plugin/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/manifest.json b/plugin/manifest.json index 16c088fd..4f93ecf8 100644 --- a/plugin/manifest.json +++ b/plugin/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "WebToEpub", - "version": "1.0.10.7", + "version": "1.0.10.8", "default_locale": "en", "icons": { "128": "book128.png" From 7d4e46484e8dd98ceffcca73c271bb0dd20743a3 Mon Sep 17 00:00:00 2001 From: nothing0074 <88822838+nothing0074@users.noreply.github.com> Date: Sun, 28 Dec 2025 09:56:18 +0700 Subject: [PATCH 06/10] reverse of previous commit --- plugin/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/manifest.json b/plugin/manifest.json index 4f93ecf8..16c088fd 100644 --- a/plugin/manifest.json +++ b/plugin/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "WebToEpub", - "version": "1.0.10.8", + "version": "1.0.10.7", "default_locale": "en", "icons": { "128": "book128.png" From 29524f2cc57492b36ac42d2ba0cf134b05ffd7a0 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 28 Dec 2025 02:57:09 +0000 Subject: [PATCH 07/10] Auto version bump for Version 1.0.10.8 --- plugin/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/manifest.json b/plugin/manifest.json index 16c088fd..4f93ecf8 100644 --- a/plugin/manifest.json +++ b/plugin/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "WebToEpub", - "version": "1.0.10.7", + "version": "1.0.10.8", "default_locale": "en", "icons": { "128": "book128.png" From 0d5d1b1798ee2b6ec569ddca68392a708d6d2882 Mon Sep 17 00:00:00 2001 From: nothing0074 <88822838+nothing0074@users.noreply.github.com> Date: Sun, 28 Dec 2025 10:10:18 +0700 Subject: [PATCH 08/10] Revert previous commit again (for real) please work --- plugin/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/manifest.json b/plugin/manifest.json index 4f93ecf8..16c088fd 100644 --- a/plugin/manifest.json +++ b/plugin/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "WebToEpub", - "version": "1.0.10.8", + "version": "1.0.10.7", "default_locale": "en", "icons": { "128": "book128.png" From 5ed8ec32a9a3035960d14b321ec21c99a7b4dcb8 Mon Sep 17 00:00:00 2001 From: nothing Date: Sun, 28 Dec 2025 12:54:37 +0700 Subject: [PATCH 09/10] LeafStudio.site added --- plugin/js/parsers/LeafStudioParser.js | 36 +++++++++++++++++++++++++++ plugin/popup.html | 1 + 2 files changed, 37 insertions(+) create mode 100644 plugin/js/parsers/LeafStudioParser.js diff --git a/plugin/js/parsers/LeafStudioParser.js b/plugin/js/parsers/LeafStudioParser.js new file mode 100644 index 00000000..0a0ee098 --- /dev/null +++ b/plugin/js/parsers/LeafStudioParser.js @@ -0,0 +1,36 @@ +"use strict"; +parserFactory.register("leafstudio.site", () => new LeafStudioParser()); + +class LeafStudioParser extends Parser { + constructor() { + super(); + } + + async getChapterUrls(dom, chapterUrlsUI) { + let menu = dom.querySelector(".novel_index"); + return util.hyperlinksToChapterList(menu).reverse(); + } + + findContent(dom) { + return dom.querySelector(".small"); + } + + extractTitleImpl(dom) { + return dom.querySelector(".title"); + } + + // Remove unwanted elements from fetched content + removeUnwantedElementsFromContentElement(element) { + ["#font-options-bar", ".confuse", ".post-rating-wrapper", "#donation-msg", ".novel_nav_item", ".text-center", ".navigation"] + .forEach(s => util.removeChildElementsMatchingSelector(element, s)); + super.removeUnwantedElementsFromContentElement(element); + } + + extractDescription(dom) { + return dom.querySelector(".desc_div").textContent.trim(); + } + + findChapterTitle(dom) { + return dom.querySelector(".title"); + } +} diff --git a/plugin/popup.html b/plugin/popup.html index bb2f4ba1..b4bf7004 100644 --- a/plugin/popup.html +++ b/plugin/popup.html @@ -725,6 +725,7 @@

Instructions

+ From a2c367051ef49e4efcfaec8ebc67d6f75a031ea5 Mon Sep 17 00:00:00 2001 From: nothing Date: Mon, 29 Dec 2025 22:56:35 +0700 Subject: [PATCH 10/10] fixed error + added myself to contributors (lol) --- package.json | 3 ++- plugin/js/parsers/LeafStudioParser.js | 5 ++--- readme.md | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a75bac2b..d2b169ea 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,8 @@ { "name": "X2E4VXpZKv" }, { "name": "johnpyp", "email": "johnpyp.dev@gmail.com" }, { "name": "meson1271" }, - { "name": "AgatZan" } + { "name": "AgatZan" }, + { "name": "nothing0074", "email": "phong322010@proton.me" } ], "license": "GPL-3.0-only", "bugs": { diff --git a/plugin/js/parsers/LeafStudioParser.js b/plugin/js/parsers/LeafStudioParser.js index 0a0ee098..b910d1cf 100644 --- a/plugin/js/parsers/LeafStudioParser.js +++ b/plugin/js/parsers/LeafStudioParser.js @@ -6,7 +6,7 @@ class LeafStudioParser extends Parser { super(); } - async getChapterUrls(dom, chapterUrlsUI) { + async getChapterUrls(dom) { let menu = dom.querySelector(".novel_index"); return util.hyperlinksToChapterList(menu).reverse(); } @@ -21,8 +21,7 @@ class LeafStudioParser extends Parser { // Remove unwanted elements from fetched content removeUnwantedElementsFromContentElement(element) { - ["#font-options-bar", ".confuse", ".post-rating-wrapper", "#donation-msg", ".novel_nav_item", ".text-center", ".navigation"] - .forEach(s => util.removeChildElementsMatchingSelector(element, s)); + util.removeChildElementsMatchingSelector(element, "#font-options-bar, .confuse, .post-rating-wrapper, #donation-msg, .novel_nav_item, .text-center, .navigation"); super.removeUnwantedElementsFromContentElement(element); } diff --git a/readme.md b/readme.md index 13d0da98..7a462cc8 100644 --- a/readme.md +++ b/readme.md @@ -809,6 +809,7 @@ Don't forget to give the project a star! Thanks again!
  • X2E4VXpZKv
  • meson1271 (Parser for jadescrolls.com)
  • AgatZan (Parser for ficbook.net)
  • +
  • nothing0074