After some discussion with the Discourse team at email, I’m updating here.
The main discovery is that thumbnails are not loaded if a link which becomes a onebox is rendered as an iframe.
This means that the link:
https://app.everviz.com/embed/N0dDTJaOQ
Will and will not render a thumbnail depending on whether iframes are allowed from the domain (allowed iframes). The solution to this is to somehow inject an iframe to the post. I made a plugin which does so, and makes sure display: none is set on the image, to prevent it from appearing in the post.
I imagine it is possible to generalize this to either:
- For all generic oneboxes, silently load and hide an image next to it if
get_oembed.thumbnail_urlexists. - Arguably a better solution, add general support for extracting
get_oembed.thumbnail_urland associating it with the post, without it being part of thecookedarea itself.
Relavant places:
- https://oembed.com/
- discourse/lib/onebox/engine at main · discourse/discourse · GitHub
- discourse/lib/onebox/engine/standard_embed.rb at main · discourse/discourse · GitHub
I am not super happy about this modal behavior, that is, is allowed iframes enabled or not? It would be nice if Discourse extracts and makes use of all properties from a given oembed endpoint when it first sends a GET to it.