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

[BUG] base href in whatsapp.html is causing invalid media links on chats #126

Open
fschuh opened this issue Dec 23, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@fschuh
Copy link

fschuh commented Dec 23, 2024

  • WhatsApp version: 24.25.89
  • OS: [iOS] - 17.6.1
  • Platform: Windows 11
  • Exporter's branch and version: main - 0.10.5

base href is causing invalid media links on chats
The base href that was added on this commit is causing media links on the chats to point to an incorrect location.

Here is what the base href looks like on one my generated html files:

<base href="AppDomainGroup-group.net.whatsapp.WhatsApp.shared/" target="_blank">

And here is an image link in the same html file:

<a href="AppDomainGroup-group.net.whatsapp.WhatsApp.shared\separated\my_group\6b58fe4562e29afa88a82e051e380324.jpg">
										<img src="AppDomainGroup-group.net.whatsapp.WhatsApp.shared\separated\my_group\6b58fe4562e29afa88a82e051e380324.jpg" loading="lazy">
									</a>

Note that both the base href and the image have the same base prefix. This causes the web browser to duplicate the prefix, resolving it to an invalid link that looks like this:

<a href="AppDomainGroup-group.net.whatsapp.WhatsApp.shared\AppDomainGroup-group.net.whatsapp.WhatsApp.shared\separated\my_group\6b58fe4562e29afa88a82e051e380324.jpg">
										<img src="AppDomainGroup-group.net.whatsapp.WhatsApp.shared\AppDomainGroup-group.net.whatsapp.WhatsApp.shared\separated\my_group\6b58fe4562e29afa88a82e051e380324.jpg" loading="lazy">
									</a>

Commenting out the base href element in whatsapp.html fixes the issue. I'm only reporting the bug rather than submitting a PR because it's unclear to me what the goal of adding that base href is, so I'm just pointing it out.

@KnugiHK
Copy link
Owner

KnugiHK commented Dec 23, 2024

Hi. Thanks for pointing this out. The purpose of using base path is to reduce the overall size of an HTML file.

@KnugiHK KnugiHK self-assigned this Dec 23, 2024
@KnugiHK KnugiHK added the bug Something isn't working label Dec 23, 2024
KnugiHK added a commit that referenced this issue Jan 2, 2025
@KnugiHK
Copy link
Owner

KnugiHK commented Jan 2, 2025

Fixed in cf03bfb. I believe this issue only affect users who use the --create-separated-media option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants