imgListener(img).then(() => {
ok(true, "img shouldn't be loaded");
// `iframe` is a content iframe, and thus not in the same docgroup with
// us, which are a chrome-privileged test.
//
// Ensure the frame is laid out so that this cross-origin
// getComputedStyle call is guaranteed to work after bug 1440537. iframe.getBoundingClientRect();
// Now prepare for the next test, deny image.
return new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [["permissions.default.image", 2]]}, resolve)
});
}).then(() => {
// Now image is denied, loading image will be rejected with REJECT_TYPE.
img3.src = "https://example.com/tests/image/test/mochitest/shaver.png";
doc.body.appendChild(img3);
return imgListener(img3);
}).then(() => {
ok(true, "img3 shouldn't be loaded");
SimpleTest.finish();
}).catch((e) => {
// Expected early return
if(e === true) {
SimpleTest.finish();
return;
}
ok(false, "throwing " + e);
});
};
// file_blocking_image.html contains meta tag for CSP, which will block images from
// http. iframe.src = "http://mochi.test:8888/chrome/dom/base/test/file_blocking_image.html";
document.getElementById("content").appendChild(iframe);
}
</script>
</pre>
<p id="display"></p>
<div id="content">
</div>
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.