Skip to content

Commit

Permalink
Add Site readernovel.net
Browse files Browse the repository at this point in the history
  • Loading branch information
ImLJS committed Dec 4, 2024
1 parent b812d3a commit ed18203
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
51 changes: 51 additions & 0 deletions plugin/js/parsers/ReaderNovelParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"use strict";

parserFactory.register("readernovel.net", () => new ReaderNovelParser());

class ReaderNovelParser extends Parser {
constructor() {
super();
}

async getChapterUrls(dom) {
return [...dom.querySelectorAll(".chapter-list-wrapper a")]
.map(link => this.linkToChapter(link))
.reverse();
}

linkToChapter(link) {
let title = link.getAttribute("title");
return ({
sourceUrl: link.href,
title: title,
});
}

findContent(dom) {
return (
dom.querySelector("div#chapter-container") || dom.querySelector("#chapter-content")
);
}

extractTitleImpl(dom) {
return dom.querySelector(".page-title");
}

extractAuthor(dom) {
let authorLabel = dom.querySelector("li.list-group-item a");
return authorLabel?.textContent ?? super.extractAuthor(dom);
}

findChapterTitle(dom) {
return dom.querySelector("span.chapter-title");
}

findCoverImageUrl(dom) {
return util.getFirstImgSrc(dom, ".manga-image");
}

getInformationEpubItemChildNodes(dom) {
return [...dom.querySelectorAll("div#collapseSummary")];
}

}
1 change: 1 addition & 0 deletions plugin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ <h3>Instructions</h3>
<script src="js/parsers/RanobesParser.js"></script>
<script src="js/parsers/RainOfSnowParser.js"></script>
<script src="js/parsers/ReadComicOnlineParser.js"></script>
<script src="js/parsers/ReaderNovelParser.js"></script>
<script src="js/parsers/ReadhiveParser.js"></script>
<script src="js/parsers/ReadLightNovelCcParser.js"></script>
<script src="js/parsers/ReadLightNovelParser.js"></script>
Expand Down

0 comments on commit ed18203

Please sign in to comment.