<!DOCTYPEHTML>
<meta charset="utf-8">
<title>Test for SRI console messages</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script>
SimpleTest.waitForExplicitFinish();
async function testSRIWarnings({ triggerLoad, messages }) {
let waitForConsole = new Promise(resolve => {
SimpleTest.monitorConsole(resolve, messages);
});
await triggerLoad();
info(`ending monitorConsole`);
SimpleTest.endMonitorConsole();
info(`waiting for console`);
await waitForConsole;
}
const kTests = [
{
triggerLoad() {
let link = document.createElement("link"); link.rel = "stylesheet"; link.href = "style1.css"; link.integrity = "sha384-invalid";
return new Promise(r => { link.onerror = r;
document.head.appendChild(link);
});
},
messages: [
{
errorMessage: /The hash contained in the integrity attribute has the wrong length/,
},
{
errorMessage: /None of the “sha384” hashes in the integrity attribute match the content of the subresource/,
sourceName: location.href,
}
],
}
];
(async function() {
let i = 0;
for (const test of kTests) {
info("Starting test: " + ++i);
await testSRIWarnings(test);
}
SimpleTest.finish();
}());
</script>
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.31 Sekunden
(vorverarbeitet am 2026-08-27)
¤
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.