Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwrite img src with data-src #408

Merged
merged 4 commits into from
Sep 23, 2024
Merged

Overwrite img src with data-src #408

merged 4 commits into from
Sep 23, 2024

Conversation

wanderor
Copy link
Contributor

Many website (e.g. Wechat) sets a placeholder for img src and loads the actual URL lazily. Mozilla Readability attempted to recognize and handle it, but the logic is narrow and does not cover many cases. Instead, this code change aggressively assume that we can overwrite img src with data-src, etc.

Also: Log console.log()

Many website (e.g. Wechat) sets a placeholder for img src and loads the actual URL lazily. Mozilla Readability attempted to recognize and handle it, but the logic is narrow and does not cover many cases. Instead, this code change aggressively assume that we can overwrite img src with data-src, etc.
@plateaukao
Copy link
Owner

@wanderor
Thanks for the pull request.
Could you provide several links that I can check the difference before and after the pr?

@wanderor
Copy link
Contributor Author

Hi @plateaukao

On second thought, maybe let's hold this pull request for a while?
Instead, I'm directly modifying Mozilla Readability to enhance its detection of lazy image:
mozilla/readability#910
If that is accepted, I can update the einkbro version accordingly. How about that?

FYI, one test URL would be:
https://mp.weixin.qq.com/s?__biz=MzIzNzcxMTU5OA==&mid=2247503512&idx=1&sn=e657b77bef1cf6f77410e3d8ba8b427b
In normal mode, when you scroll down the page, the images will be lazily loaded.
OTOH, if you scroll the page to top and reload the page to clear loaded images, then enter reader mode, the images will be missing.

@plateaukao plateaukao merged commit acf0140 into plateaukao:main Sep 23, 2024
1 check failed
@plateaukao
Copy link
Owner

@wanderor
Let me merge it first on EinkBro, since I don't know how long it make take for firefox to merge the PR. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants