Make WordPress Core

Ticket #34698: 34698.2.diff

File 34698.2.diff, 1.6 KB (added by pento, 10 years ago)
  • src/wp-includes/js/wp-embed.js

     
    11(function ( window, document ) {
    22        'use strict';
    33
    4         var supportedBrowser = ( document.querySelector && window.addEventListener ),
     4        var supportedBrowser = false,
    55                loaded = false;
    66
     7                if ( document.querySelector ) {
     8                        if ( window.addEventListener ) {
     9                                supportedBrowser = true;
     10                        }
     11                }
     12
    713        window.wp = window.wp || {};
    814
    915        if ( !! window.wp.receiveEmbedMessage ) {
     
    5056                                targetURL.href = data.value;
    5157
    5258                                /* Only continue if link hostname matches iframe's hostname. */
    53                                 if ( targetURL.host === sourceURL.host && document.activeElement === source ) {
    54                                         window.top.location.href = data.value;
     59                                if ( targetURL.host === sourceURL.host ) {
     60                                        if ( document.activeElement === source ) {
     61                                                window.top.location.href = data.value;
     62                                        }
    5563                                }
    5664                        }
    5765                }
     
    8593                        }
    8694
    8795                        /* Remove security attribute from iframes in IE10 and IE11. */
    88                         if ( ( isIE10 || isIE11 ) && !!source.getAttribute( 'security' ) ) {
    89                                 iframeClone = source.cloneNode( true );
    90                                 iframeClone.removeAttribute( 'security' );
    91                                 source.parentNode.replaceChild( iframeClone, source );
     96                        if ( ( isIE10 || isIE11 ) ) {
     97                                if ( !!source.getAttribute( 'security' ) ) {
     98                                        iframeClone = source.cloneNode( true );
     99                                        iframeClone.removeAttribute( 'security' );
     100                                        source.parentNode.replaceChild( iframeClone, source );
     101                                }
    92102                        }
    93103                }
    94104        }