Yo does anyone know how we should make it so embedded toots iframes have the correct height of the toot? Anyone with experience creating embeds for stuff?
As far as I'm aware the only way is to include a <script> along with the <iframe> code which load from the same domain as the iframe, because otherwise JS cannot access the iframe's content
@Gargron why include scripts?
@saper because <iframe> does not resize together with its inner content
@Gargron ok maybe iframe is a wrong tool for the job, don't know
@saper do you have another mechanism by which content from one website is included on another? 🤔
@Gargron some js importing toots via API? If JS is required indeed?

@saper @Gargron JS rendering a toot via API / JSON isn't a bad way to go at all, you'd just handle all of the styling on the recipient end. As a bonus, it can be integrated into something like WordPress as a plugin.

Given the decentralized nature of the network, I can't advocate using something like OEmbed, since that often requires whitelisting domains for the renderer (or ignoring a whitelist entirely).

@deadsuperhero @saper OEmbed does not require whitelists. OEmbed is discovery-based.
@Gargron @saper But as a sane practice, you would probably want to only allow a short list of providers. At the very least, this seems to be something that is practiced by networks that consume said embeds in a social stream.
@deadsuperhero @saper Facebook, Discord and Twitter use Open Graph tags, not OEmbed. Discourse *does* use OEmbed, but their implementation *does* use a whitelist (however the argument for it is simply "back when we implemented it nobody used OEmbed except these sites"). I don't know of any other social streams that embed anything
@Gargron I have no idea, but Twitter does this thing which is super nice for embedded tweets: they’re blockquotes, not iframes. So the content is kept in articles inserting the tweets, and it works nicely for accessibility and posterity :)
@nclm It's a blockquote and a script, and when the script loads it replaces the blockquote with an iframe.
@Gargron Yes, you’re right! But as long as there is a blockquote there, I’m happy (Firefox’s tracking protection actually blocks the thing that makes them into frames, so I’m used to the blockquotes alone).
@nclm Right, but in case <script> is blocked, an iframe is still better than a blockquote, no? Because it displays rich content, albeit at wrong height..?