Skip to content

mastodon-embed class missing on some embeds #20

Open
@stefanbohacek

Description

@stefanbohacek

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions