summaryrefslogtreecommitdiffstats
path: root/dom/security/test/general/test_nosniff_navigation.html
blob: 6710f4f5b9a79488a94965ea1a39ddb556e26035 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE HTML>
<html>

<head>
  <title>Bug 1428473 Support X-Content-Type-Options: nosniff when navigating</title>
  <!-- Including SimpleTest.js so we can use waitForExplicitFinish !-->
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>

<body>

  <!-- add the two script tests -->
  <script id="scriptCorrectType"></script>
  <script id="scriptWrongType"></script>

  <script class="testbody" type="text/javascript">
    /* Description of the test:
     * We're testing if Firefox respects the nosniff Header for Top-Level 
     * Navigations.
     * If Firefox cant Display the Page, it will prompt a download 
     * and the URL of the Page will be about:blank.
     * So we will try to open different content send with
     * no-mime, mismatched-mime and garbage-mime types.
     * 
     */

    SimpleTest.waitForExplicitFinish();

    window.addEventListener("load", async () => {
      window.open("window_nosniff_navigation.html");
    });
  </script>
</body>
</html>