Skip to content

Commit

Permalink
ReadComicOnline.li: fix website (#7275)
Browse files Browse the repository at this point in the history
* FIX : ReadComicOnline.li : updated script to get image URLs as the old JS variable is removed

Fixes 'lstImages is not defined' error and also catches the error instead of failing with a timeout

* implement suggestion by @ronny1982 , replacing blogspot size parameters with =s0

* Forgot to escape backslash with JS backtick quotes
  • Loading branch information
peternoordijk authored and ronny1982 committed Jul 27, 2024
1 parent deb4ee8 commit 176c5b4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/web/mjs/connectors/KissComic.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,15 @@ export default class KissComic extends Connector {
const script = `
new Promise((resolve, reject) => {
setTimeout(() => {
resolve(lstImages);
try {
resolve(
Array.from(document.querySelectorAll('#divImage img'))
.map(img => (img.src || '').replace(/=s\\d+/, '=s0'))
.filter(Boolean)
)
} catch (err) {
reject(err);
}
}, 1000);
});
`;
Expand Down

0 comments on commit 176c5b4

Please sign in to comment.