variframe = document.getElementById('iframe'); var iframeCw = iframe.contentWindow;
if (loadCount == 1) {
// Test 1: Navigate iframe1. This page should be the referer.
// We'll get a callback from the inner page when its iframe finishes
// loading, so get rid of the onload listener on our iframe.
// Change this page's URI using replaceState; the referrer should be this
// new value, not our original location.
history.replaceState('', '', Math.random());
iframe.onload = null;
iframeCw.location = 'file_bug593174_2.html';
}
else if (loadCount == 2) {
// Test 1: Check that this page is the referer.
is(iframeCw.document.referrer, String(document.location), 'outer iframe referrer');
// Test 2: file_bug593174_2.html itself contains an iframe, whose src is a
// data: uri. Call into that inner iframe and have it set its
// document.location. The new document's referrer should be
// file_bug593174_2.html.
// We'll get a call to iframeLoaded when this finishes.
iframeCw.navigateInnerIframe();
}
else if (loadCount == 3) {
is(iframeCw.getInnerIframeReferrer(), String(iframeCw.location), 'inner iframe referrer');
// Now do the test again, this time with a popup.
popup = window.open('file_bug593174_1.html');
popup.onload = iframeLoaded('popup/outer');
}
else if (loadCount == 4) {
history.replaceState('', '', Math.random());
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.