-
Notifications
You must be signed in to change notification settings - Fork 3
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
Link previews aren't working with Signal #9
Comments
I wonder if the format that Signal expects is different from the format that psky is serving. The next step would to figure out Signal's user agent, then |
here's the signal ios link preview fetcher code, for example: https://github.com/signalapp/Signal-iOS/blob/2ee794f3171d1fbb56a9f5331edc9e82a2434e3f/SignalUI/Utils/LinkPreviewFetcher.swift#L4 derp that link is less useful than i thought... |
It looks like Signal identifies itself as WhatsApp in the user agent, for Reasons™ (anti-fingerprinting, but also Twitter apparently only returns tags for known user agents). See signalapp/Signal-Android#10060 (issue is closed, but some more recent issues suggest that it's still the case) |
Blegh, my usual testing flow (that works with Telegram and Discord) doesn't work here because I need https.......
iirc there should be a way to listen on https and get the raw HTTP data.... maybe httpbin? |
https://requestinspector.com/ does not work with Telegram or Signal embeds OpenSSL might work but it'll probably be self-signed and Signal will probably not fetch it, but it might. |
I think just
vxtwitter does a redirect for Edit: no hits in vxtwitter source code, but it does look like WhatsApp is the correct user agent.... |
Okay, success at original technique by using a Caddyfile as follows:
So it's What does vxtwitter do with that....... I think nothing, I think it just redir's to Twitter and Signal parses the preview out of there. |
I'm not sure what Signal is doing! It could be that it relies on the oembed.json that I've commented out, but I'm skeptical. Requests do hit the python process running psky.app, but Signal must not like the response for some reason. This also doesn't work:
My guess is that Signal gets the full http response from e.g. Twitter, and parses out whatever fields it wants in some way. But I'm not sure how. The code is here: https://github.com/signalapp/Signal-Desktop/blob/9ad9b4da0f4447876490e2dbc462a2b7316dd128/ts/services/LinkPreview.ts#L333 The logs reporting failure are pretty boring:
This code does in fact parse it with This is probably returning null because my HTML is malformed somewhere? |
Yes, here, Because |
Found it! Signal expects an Link previews should work across the board in Signal now. I'll commit the code another time since it's late. Thanks for the issue and help, @ChimeraCoder and @jasikpark ! |
yayyyy |
I came here to file a feature request for link previews, but from the other issues, it looks like it's actually supported and working on other platforms. For some reason, the link previews don't seem to be working on Signal (either Android or iOS), even when link previews are available, and even though they work for Twitter links (both text and images).
Because Signal supports link previews for all sites served over SSL/TLS, and because it works for other websites on Signal but consistently not for psky, I think this is an issue on psky's end.
Example of missing preview before message is sent (psky):
Example of preview before message is sent (Twitter):
Example of preview after message is sent (Twitter):
The text was updated successfully, but these errors were encountered: