Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dteviot committed Jul 23, 2023
1 parent e4c5a54 commit 45b0080
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions plugin/js/parsers/KaystlsParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"use strict";

parserFactory.register("kaystls.site", () => new KaystlsParser());

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

async getChapterUrls(dom) {
return [...dom.querySelectorAll("div.wp-block-columns a.wp-block-navigation-link__content")]
.map(a => util.hyperLinkToChapter(a));
}

findContent(dom) {
return dom.querySelector("div.wp-block-columns");
}

extractTitleImpl(dom) {
return dom.querySelector("div.wp-block-columns.alignwide h1");
}

findCoverImageUrl(dom) {
return util.getFirstImgSrc(dom, "div.wp-block-cover");
}
}
1 change: 1 addition & 0 deletions plugin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ <h3>Instructions</h3>
<script src="js/parsers/JpmtlParser.js"></script>
<script src="js/parsers/KakaoParser.js"></script>
<script src="js/parsers/KakuyomuParser.js"></script>
<script src="js/parsers/KaystlsParser.js"></script>
<script src="js/parsers/KemonopartyParser.js"></script>
<script src="js/parsers/KrytykalParser.js"></script>
<script src="js/parsers/LibersparkParser.js"></script>
Expand Down

0 comments on commit 45b0080

Please sign in to comment.