WhatsApp-Chat-Exporter icon indicating copy to clipboard operation
WhatsApp-Chat-Exporter copied to clipboard

[FEATURE] Better loading of media

Open KnugiHK opened this issue 1 month ago • 1 comments

Discussed in https://github.com/KnugiHK/WhatsApp-Chat-Exporter/issues/90

@jonx suggested:

I'm not a web developer but I did some quick research and maybe all we need to get the lazy loading is add a tag to the images as documented here: https://www.w3schools.com/tags/att_img_loading.asp Only Safari doesn't handle this tag.

<img src="Media/Profile\33610007857-1665000879.thumb" loading="lazy" class="avatar">

Also while commenting on things that I don't really know, maybe you could consider using the base tag in your HTML? Maybe you have a reason not to use it or maybe it's just me but my links are pretty long like this: <a href="AppDomainGroup-group.net.whatsapp.WhatsApp.shared/Media/Profile\6590002603-1700006881.thumb"><img src="AppDomainGroup-group.net.whatsapp.WhatsApp.shared/Media/Profile\6590002603-1700006881.thumb" onerror="this.style.display='none'" class="avatar"></a> with the base tag like this: <base href="AppDomainGroup-group.net.whatsapp.WhatsApp.shared/"> you should be able to shorten the URLs to this: <img src="Media/Profile\33610007857-1665000879.thumb">

KnugiHK avatar Jun 30 '24 11:06 KnugiHK