Skip to content

Commit

Permalink
Merge pull request #1074 from toptaran/ExperimentalTabMode
Browse files Browse the repository at this point in the history
Fix: fixLazyLoadImageSource when image source in data-src attribute
  • Loading branch information
dteviot authored Sep 13, 2023
2 parents 241baa5 + 6c65336 commit 70dd1f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
{ "name": "Dimava"},
{ "name": "Leone Jacob Sunil (ImLJS)"},
{ "name": "Yoanhg421"},
{ "name": "xRahul"}
{ "name": "xRahul"},
{ "name": "Oleksii Taranenko"}
],
"license": "GPL-3.0-only",
"bugs": {
Expand Down
9 changes: 6 additions & 3 deletions plugin/js/ImageCollector.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,12 @@ class ImageCollector {
}
}

let lazySrc = img.getAttribute("data-lazy-src");
if (lazySrc != null) {
img.src = lazySrc;
for(let attrib of ["data-lazy-src", "data-src"]) {
let lazySrc = img.getAttribute(attrib);
if (lazySrc != null) {
img.src = lazySrc;
break;
}
}
return img.src;
}
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Credits
* Yoanhg421
* Leone Jacob Sunil (ImLJS)
* xRahul
* Oleksii Taranenko

## How to use with Baka-Tsuki:
* Browse to a Baka-Tsuki web page that has the full text of a story.
Expand Down Expand Up @@ -166,4 +167,4 @@ WebToEpub uses the following libraries:
> * Find `security.fileuri.strict_origin_policy` parameter
> * Set it to false
> * Load `unitTest/Tests.html`
> * (Remember to reset `security.fileuri.strict_origin_policy` to true when done.
> * (Remember to reset `security.fileuri.strict_origin_policy` to true when done.

0 comments on commit 70dd1f9

Please sign in to comment.