Heartbeat: in isLocalFrame() compare window.location.origin to iframe.src to stop most cases where WebKit triggers errors about different iframe origin, see #23216
git-svn-id: http://core.svn.wordpress.org/trunk@24384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1d1286624d
commit
bcdb12da79
|
@ -65,7 +65,16 @@ window.wp = window.wp || {};
|
|||
return (new Date()).getTime();
|
||||
}
|
||||
|
||||
function isLocalFrame(frame) {
|
||||
function isLocalFrame( frame ) {
|
||||
var origin, src = frame.src;
|
||||
|
||||
if ( src && /^https?:\/\//.test( src ) ) {
|
||||
origin = window.location.origin ? window.location.origin : window.location.protocol + '//' + window.location.host;
|
||||
|
||||
if ( src.indexOf( origin ) !== 0 )
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
if ( frame.contentWindow.document )
|
||||
return true;
|
||||
|
@ -150,7 +159,7 @@ window.wp = window.wp || {};
|
|||
data: send,
|
||||
dataType: 'json'
|
||||
}).done( function( response, textStatus, jqXHR ) {
|
||||
var new_interval, timed;
|
||||
var new_interval;
|
||||
|
||||
if ( ! response )
|
||||
return errorstate( 'empty' );
|
||||
|
|
Loading…
Reference in New Issue