[wp-trac] [WordPress Trac] #52768: WordPress post URL oEmbed rendering blocked by iframe lazy-loading

WordPress Trac noreply at wordpress.org
Fri Mar 26 23:02:48 UTC 2021


#52768: WordPress post URL oEmbed rendering blocked by iframe lazy-loading
---------------------------+--------------------------
 Reporter:  SirStuey       |       Owner:  flixos90
     Type:  defect (bug)   |      Status:  assigned
 Priority:  normal         |   Milestone:  5.7.1
Component:  Embeds         |     Version:  5.7
 Severity:  normal         |  Resolution:
 Keywords:  needs-testing  |     Focuses:  performance
---------------------------+--------------------------
Changes (by flixos90):

 * owner:  (none) => flixos90
 * status:  new => assigned


Comment:

 I believe the underlying issue here is related to the iframe being
 visually hidden, and that's the reason the browser's lazy-loading
 implementation may interpret it as irrelevant for being loaded. Then,
 because it is not loaded, it does not send the `postMessage` to the
 embedding page which would be required for the `wp-embed.js` logic that
 makes it visible to kick in.

 I suggest the following: Until we can come up with an actual solution for
 WordPress embeds (and any other embeds that rely on being hidden in
 combination with `wp-embed.js` to work), we disable lazy-loading for
 those. This can be accomplished by not adding the `loading` attribute to
 the iframe if it has a `data-secret` attribute (which is used to associate
 the iframe with fallback content and then hide it initially).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52768#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list