file_image_nonce.html (1444B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset='utf-8'> 5 <title>Bug 1355801: Nonce should not apply to images</title> 6 </head> 7 <body> 8 9 <img id='matchingNonce' src='http://mochi.test:8888/tests/image/test/mochitest/blue.png?a' nonce='abc'></img> 10 <img id='nonMatchingNonce' src='http://mochi.test:8888/tests/image/test/mochitest/blue.png?b' nonce='bca'></img> 11 <img id='noNonce' src='http://mochi.test:8888/tests/image/test/mochitest/blue.png?c'></img> 12 13 <script type='application/javascript'> 14 var matchingNonce = document.getElementById('matchingNonce'); 15 matchingNonce.onload = function(e) { 16 window.parent.postMessage({result: 'img-with-matching-nonce-loaded'}, '*'); 17 }; 18 matchingNonce.onerror = function(e) { 19 window.parent.postMessage({result: 'img-with-matching-nonce-blocked'}, '*'); 20 } 21 22 var nonMatchingNonce = document.getElementById('nonMatchingNonce'); 23 nonMatchingNonce.onload = function(e) { 24 window.parent.postMessage({result: 'img-with_non-matching-nonce-loaded'}, '*'); 25 }; 26 nonMatchingNonce.onerror = function(e) { 27 window.parent.postMessage({result: 'img-with_non-matching-nonce-blocked'}, '*'); 28 } 29 30 var noNonce = document.getElementById('noNonce'); 31 noNonce.onload = function(e) { 32 window.parent.postMessage({result: 'img-without-nonce-loaded'}, '*'); 33 }; 34 noNonce.onerror = function(e) { 35 window.parent.postMessage({result: 'img-without-nonce-blocked'}, '*'); 36 } 37 </script> 38 </body> 39 </html>