diff --git a/src/wp-includes/js/wp-oembed-embed.js b/src/wp-includes/js/wp-oembed-embed.js
index 847ebcf..bc40479 100644
a
|
b
|
|
13 | 13 | } |
14 | 14 | |
15 | 15 | function onLoad() { |
| 16 | window.removeEventListener( 'load', onLoad, false ); |
| 17 | |
16 | 18 | var share_dialog = document.querySelector( '.wp-embed-share-dialog' ), |
17 | 19 | share_dialog_open = document.querySelector( '.wp-embed-share-dialog-open' ), |
18 | 20 | share_dialog_close = document.querySelector( '.wp-embed-share-dialog-close' ), |
… |
… |
|
141 | 143 | } |
142 | 144 | } |
143 | 145 | |
144 | | document.addEventListener( 'DOMContentLoaded', onLoad, false ); |
145 | | |
146 | 146 | /** |
147 | 147 | * Iframe resize handler. |
148 | 148 | */ |
… |
… |
|
158 | 158 | }, 100 ); |
159 | 159 | } |
160 | 160 | |
161 | | window.addEventListener( 'resize', onResize, false ); |
| 161 | /** |
| 162 | * Ensure required features exist. |
| 163 | */ |
| 164 | function featurePass() { |
| 165 | if ( ( 'addEventListener' in window ) && |
| 166 | ( 'querySelector' in document ) ) { |
| 167 | return true; |
| 168 | } |
| 169 | return false; |
| 170 | } |
| 171 | |
| 172 | if ( featurePass() ) { |
| 173 | document.addEventListener( 'DOMContentLoaded', onLoad, false ); |
| 174 | window.addEventListener( 'load', onLoad, false ); |
| 175 | window.addEventListener( 'resize', onResize, false ); |
| 176 | } |
162 | 177 | })( window, document ); |
diff --git a/src/wp-includes/js/wp-oembed.js b/src/wp-includes/js/wp-oembed.js
index dd03bc0..bef8db9 100644
a
|
b
|
|
44 | 44 | } |
45 | 45 | }; |
46 | 46 | |
47 | | window.addEventListener( 'message', window.wp.receiveEmbedMessage, false ); |
48 | | |
49 | 47 | function onLoad() { |
| 48 | window.removeEventListener( 'load', onLoad, false ); |
| 49 | |
50 | 50 | var isIE10 = -1 !== navigator.appVersion.indexOf( 'MSIE 10' ), |
51 | 51 | isIE11 = !!navigator.userAgent.match( /Trident.*rv\:11\./ ); |
52 | 52 | |
… |
… |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | | document.addEventListener( 'DOMContentLoaded', onLoad, false ); |
| 66 | /** |
| 67 | * Ensure required features exist. |
| 68 | */ |
| 69 | function featurePass() { |
| 70 | if ( ( 'addEventListener' in window ) && |
| 71 | ( 'querySelector' in document ) ) { |
| 72 | return true; |
| 73 | } |
| 74 | return false; |
| 75 | } |
| 76 | |
| 77 | if ( featurePass() ) { |
| 78 | document.addEventListener( 'DOMContentLoaded', onLoad, false ); |
| 79 | window.addEventListener( 'load', onLoad, false ); |
| 80 | window.addEventListener( 'message', window.wp.receiveEmbedMessage, false ); |
| 81 | } |
67 | 82 | })( window, document ); |