[wp-trac] [WordPress Trac] #60147: Possible bug when YouTube embeds having both loading=lazy attribute and the enablejsapi parameter

WordPress Trac noreply at wordpress.org
Sun Dec 24 00:01:04 UTC 2023


#60147: Possible bug when YouTube embeds having both loading=lazy attribute and the
enablejsapi parameter
--------------------------+-----------------------------
 Reporter:  asafm7        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Embeds        |    Version:
 Severity:  normal        |   Keywords:
  Focuses:  performance   |
--------------------------+-----------------------------
 When YouTube embeds have loading=lazy attribute and the enablejsapi
 parameter, a console error is showing:

 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided
 ('https://www.youtube.com') does not match the recipient window's origin
 ('https://hobbies4.life').

 I tried setting the origin and widget_referrer and it didn't help.

 It means embeds can't be both lazy loaded and tracked for analytics.

 I've opened a bug 3 times on the YouTube Issue Tracker and every time it
 was closed as "not reproducible", although it can be reproduced.

 Maybe it relates to the way WordPress implements the API?

 All details can be found here:
 https://issuetracker.google.com/issues/306734400#comment1

 Please let me know if more information is required.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60147>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list