<!-- Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPEHTML>
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Bug 1152899 - Disallow the interception of third-party iframes using service workers when the third-party cookie preference is set</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script class="testbody" type="text/javascript">
var chromeScript;
chromeScript = SpecialPowers.loadChromeScript(_ => {
/* eslint-env mozilla/chrome-script */
Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
});
let index = 0;
function next() {
info("Step " + index);
if (index >= steps.length) {
SimpleTest.finish();
return;
}
try {
let i = index++;
steps[i]();
} catch(ex) {
ok(false, "Caught exception", ex);
}
}
onload = next;
let iframe;
let proxyWindow;
let basePath = "/tests/dom/serviceworkers/test/thirdparty/";
let origin = window.location.protocol + "//" + window.location.host;
let thirdPartyOrigin = "https://example.com";
function loadIframe() {
let message = { source: "parent",
href: origin + basePath + "iframe2.html"
}; iframe.contentWindow.postMessage(message, "*");
}
function loadThirdPartyIframe() {
let message = { source: "parent",
href: thirdPartyOrigin + basePath + "iframe2.html"
} iframe.contentWindow.postMessage(message, "*");
}
function runTest(aExpectedResponses) {
// Let's use a proxy window to have the new cookie policy applied.
proxyWindow = window.open("window_party_iframes.html");
proxyWindow.onload = _ => { iframe = proxyWindow.document.querySelector("iframe"); iframe.src = thirdPartyOrigin + basePath + "register.html";
let responsesIndex = 0;
window.onmessage = function(e) {
let status = e.data.status;
let expected = aExpectedResponses[responsesIndex];
if (status == expected.status) {
ok(true, "Received expected " + expected.status);
if (expected.next) {
expected.next();
}
} else {
ok(false, "Expected " + expected.status + " got " + status);
}
responsesIndex++;
};
}
}
¤ 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.0.43Bemerkung:
(vorverarbeitet)
¤
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.