Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'>
<title>Bug 1355801: Nonce should not apply to images</title>
</head>
<body>
<img id='matchingNonce' src='http://mochi.test:8888/tests/image/test/mochitest/blue.png?a' nonce='abc'></img>
<img id='nonMatchingNonce' src='http://mochi.test:8888/tests/image/test/mochitest/blue.png?b' nonce='bca'></img>
<script type='application/javascript'>
var matchingNonce = document.getElementById('matchingNonce');
matchingNonce.onload = function(e) {
window.parent.postMessage({result: 'img-with-matching-nonce-loaded'}, '*');
};
matchingNonce.onerror = function(e) {
window.parent.postMessage({result: 'img-with-matching-nonce-blocked'}, '*');
}
var nonMatchingNonce = document.getElementById('nonMatchingNonce');
nonMatchingNonce.onload = function(e) {
window.parent.postMessage({result: 'img-with_non-matching-nonce-loaded'}, '*');
};
nonMatchingNonce.onerror = function(e) {
window.parent.postMessage({result: 'img-with_non-matching-nonce-blocked'}, '*');
}
var noNonce = document.getElementById('noNonce');
noNonce.onload = function(e) {
window.parent.postMessage({result: 'img-without-nonce-loaded'}, '*');
};
noNonce.onerror = function(e) {
window.parent.postMessage({result: 'img-without-nonce-blocked'}, '*');
}
</script>
</body>
</html>