test_nosniff_navigation.html (1071B)
1 <!DOCTYPE HTML> 2 <html> 3 4 <head> 5 <title>Bug 1428473 Support X-Content-Type-Options: nosniff when navigating</title> 6 <!-- Including SimpleTest.js so we can use waitForExplicitFinish !--> 7 <script src="/tests/SimpleTest/SimpleTest.js"></script> 8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 9 </head> 10 11 <body> 12 13 <!-- add the two script tests --> 14 <script id="scriptCorrectType"></script> 15 <script id="scriptWrongType"></script> 16 17 <script class="testbody" type="text/javascript"> 18 /* Description of the test: 19 * We're testing if Firefox respects the nosniff Header for Top-Level 20 * Navigations. 21 * If Firefox cant Display the Page, it will prompt a download 22 * and the URL of the Page will be about:blank. 23 * So we will try to open different content send with 24 * no-mime, mismatched-mime and garbage-mime types. 25 * 26 */ 27 28 SimpleTest.waitForExplicitFinish(); 29 30 window.addEventListener("load", async () => { 31 window.open("window_nosniff_navigation.html"); 32 }); 33 </script> 34 </body> 35 </html>