Skip to content
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

mastodon-embed class missing on some embeds #20

Open
stefanbohacek opened this issue Jul 30, 2023 · 1 comment
Open

mastodon-embed class missing on some embeds #20

stefanbohacek opened this issue Jul 30, 2023 · 1 comment
Labels
question Further information is requested

Comments

@stefanbohacek
Copy link
Owner

stefanbohacek commented Jul 30, 2023

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.

@stefanbohacek stefanbohacek added the question Further information is requested label Jul 30, 2023
@stefanbohacek
Copy link
Owner Author

I opened a ticket in the Mastodon repo. mastodon/mastodon#26265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant