WordPress.org

Make WordPress Core

Changeset 24384


Ignore:
Timestamp:
05/30/2013 12:08:53 AM (5 years ago)
Author:
azaozz
Message:

Heartbeat: in isLocalFrame() compare window.location.origin to iframe.src to stop most cases where WebKit triggers errors about different iframe origin, see #23216

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/heartbeat.js

    r24268 r24384  
    6666        }
    6767
    68         function isLocalFrame(frame) {
     68        function isLocalFrame( frame ) {
     69            var origin, src = frame.src;
     70
     71            if ( src && /^https?:\/\//.test( src ) ) {
     72                origin = window.location.origin ? window.location.origin : window.location.protocol + '//' + window.location.host;
     73
     74                if ( src.indexOf( origin ) !== 0 )
     75                    return false;
     76            }
     77
    6978            try {
    7079                if ( frame.contentWindow.document )
     
    151160                dataType: 'json'
    152161            }).done( function( response, textStatus, jqXHR ) {
    153                 var new_interval, timed;
     162                var new_interval;
    154163
    155164                if ( ! response )
Note: See TracChangeset for help on using the changeset viewer.