Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions plugin/js/parsers/PatreonParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ class PatreonParser extends Parser {
.join(" ");
};

if (this.isCondensedView(dom))
{
let getLink = (e) => {
return e.querySelector("a");
};
let linksContainer = [...dom.querySelectorAll("div.cm-hhCVrV.cm-WzHHbB div:not([class])")];
return linksContainer.map(linkContainer => {
return {
sourceUrl: getLink(linkContainer).href,
title: getTitle(linkContainer),
};
});
}

let links = [...dom.querySelectorAll("a.cm-XHOpxu")];
return links.map(link => ({
sourceUrl: link.href,
Expand Down Expand Up @@ -119,4 +133,9 @@ class PatreonParser extends Parser {
isCollectionList(dom) {
return new URL(dom.baseURI).pathname.startsWith("/collection/");
}

isCondensedView(dom) {
let url = new URL(dom.baseURI);
return url.searchParams.get("view") === "condensed";
}
}