tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

data-url.html (1159B)


      1 <!doctype html>
      2 <meta charset="utf-8">
      3 <title>Test data URL and scripts errors</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <div id=log></div>
      7 <script>
      8  setup({allow_uncaught_exception:true});
      9  async_test(function(t) {
     10    var counter = 1
     11    window.onerror = t.step_func((message, url, lineno, colno, e) => {
     12      // Test that error is not muted as data URLs have a response type of "default"
     13      // and errors should only be muted if the response type is "opaque" or "opaqueredirect"
     14      assert_not_equals(message, "Script error.")
     15      assert_not_equals(url, null);
     16      assert_not_equals(url, "");
     17      assert_equals(typeof lineno, "number");
     18      assert_not_equals(lineno, 0);
     19      assert_equals(typeof colno, "number");
     20      assert_not_equals(colno, 0);
     21      assert_equals(typeof e, "number")
     22      assert_equals(e, counter)
     23      if (counter == 3) {
     24        t.done()
     25      }
     26      counter++
     27    });
     28  });
     29 </script>
     30 <script src="data:,throw 1"></script>
     31 <script src="data:,throw 2" crossorigin></script>
     32 <script src="data:,throw 3" crossorigin=use-credentials></script>