Open
Description
Example post: https://mastodon.social/@Mastodon/110640658973976934
When embedding from mastodon.social, embed code looks like this:
<iframe
src="https://mastodon.social/@Mastodon/110640658973976934/embed"
class="mastodon-embed"
style="max-width: 100%; border: 0"
width="400"
allowfullscreen="allowfullscreen"
></iframe>
<script src="https://mastodon.social/embed.js" async="async"></script>
When embedding the same post from my own instance stefanbohacek.online:
<iframe
src="https://mastodon.social/@Mastodon/110640658973976934/embed"
width="400"
allowfullscreen="allowfullscreen"
sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-forms"
></iframe>
When embedding a post from my own instance, the class is present.
<iframe
src="https://stefanbohacek.online/@stefan/110571664231037033/embed"
class="mastodon-embed"
style="max-width: 100%; border: 0"
width="400"
allowfullscreen="allowfullscreen"
></iframe>
<script src="https://stefanbohacek.online/embed.js" async="async"></script>
The mastodon-embed
class is needed to determine which iframe is a Mastodon embed. Without it, or other specific identifiers, it would be necessary to check each domain in an iframe to see if it's a Mastodon server.
Activity