Opened 9 years ago
Closed 9 years ago
#34462 closed enhancement (fixed)
Add a text fallback for the embed iframe
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Embeds | Keywords: | |
Focuses: | Cc: |
Description
Suggested by @helen:
I would like to see a text fallback (e.g. a link) provided in the oEmbed response, much like the way Twitter includes a blockquote. I wouldn’t want to see more text from the site, but the title/site name would probably suffice.
This can be included in the oEmbed response data, then hidden when we get a message from the iframe to signal that it loaded correctly.
Attachments (2)
Change History (10)
#2
@
9 years ago
How would that look like when JavaScript is disabled? I guess the iframe needs to be hidden initially. That would work well with #34451 in mind too.
#3
@
9 years ago
Also, the if ( empty( $content[1] ) && empty( $content[2] ) )
check means a <blockquote>
is required, right? I don't think it should be. If we use blockquotes, it doesn't mean every other oEmbed provider does as well.
#4
@
9 years ago
in 34462.2.diff:
- Hide the iframe by default (if a blockquote fallback is present), then display it once it sends a message, hiding the blockquote at the same time. This causes a bit less jumping around.
- Require an iframe to be present, instead of previously requiring either a blockquote or an iframe.
- Add some unit tests.
#5
@
9 years ago
- Owner set to pento
- Resolution set to fixed
- Status changed from new to closed
In 35437:
#6
follow-up:
↓ 7
@
9 years ago
- Keywords needs-patch added; has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
You'll never receive a postMessage from an iframe that is hidden using display: none
.
I'll try to fix this together with #34451.
#7
in reply to:
↑ 6
;
follow-up:
↓ 8
@
9 years ago
Replying to swissspidy:
You'll never receive a postMessage from an iframe that is hidden using
display: none
.
Which browser did you test this on? It works fine for me in Chrome, Firefox and Safari.
#8
in reply to:
↑ 7
@
9 years ago
- Keywords needs-patch removed
- Resolution set to fixed
- Status changed from reopened to closed
Replying to pento:
Replying to swissspidy:
You'll never receive a postMessage from an iframe that is hidden using
display: none
.
Which browser did you test this on? It works fine for me in Chrome, Firefox and Safari.
Chrome. I just tested this again on trunk and couldn't reproduce it, so I guess it was something I introduced myself while working on #34451. So, sorry for acting too hastily.
34462.diff is a first pass at this.
I don't really like the flash of fallback text that appears before it's hidden, but this is the same behaviour you see with Twitter.