[wp-trac] [WordPress Trac] #44306: wp-embed-template.js Sends a message earlier than the wp-embed.js listener will be installed

WordPress Trac noreply at wordpress.org
Tue Jun 5 11:53:33 UTC 2018


#44306: wp-embed-template.js Sends a message earlier than the wp-embed.js listener
will be installed
--------------------------+------------------------------
 Reporter:  Cawa-93       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Embeds        |     Version:  4.9.6
 Severity:  major         |  Resolution:
 Keywords:                |     Focuses:  javascript
--------------------------+------------------------------

Comment (by Cawa-93):

 If, however, I pre-register the script in the header and not in the
 cellar, then the frame of the widget is displayed correctly.
 {{{#!php
 <?php
 add_action('wp_enqueue_scripts','embed_on_head',8);
 function embed_on_head() {
         wp_enqueue_script('wp-embed', includes_url( '/js/wp-embed.min.js'
 ), array(), false, false);
 }
 }}}
 Here is the log:
 {{{
 14:52:18.132 wp-embed.js?ver=4.9.6:121 addEventListener(message)
 14:52:19.536 (index):758 sendEmbedMessage(height, 299)
 14:52:19.574 wp-embed.js?ver=4.9.6:31  receiveEmbedMessage data: {message:
 "height", value: 299, secret: "Fr0AAXkEeU"}
 14:52:21.533 wp-embed.js?ver=4.9.6:89 onLoad()
 14:52:22.409 (index):758 sendEmbedMessage(height, 299)
 14:52:22.510 wp-embed.js?ver=4.9.6:31  receiveEmbedMessage data: {message:
 "height", value: 299, secret: "Fr0AAXkEeU"}
 14:52:23.259 wp-embed.js?ver=4.9.6:89 onLoad()
 }}}

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


More information about the wp-trac mailing list