tor-browser

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

xmlhttprequest-sync-default-feature-policy.sub.html (910B)


      1 <!DOCTYPE html>
      2 <body>
      3  <meta charset="utf-8">
      4  <title>Synchronous XMLHttpRequest Feature Policy Test</title>
      5  <script src=/resources/testharness.js></script>
      6  <script src=/resources/testharnessreport.js></script>
      7  <script src=/feature-policy/resources/featurepolicy.js></script>
      8  <script src=util/utils.js></script>
      9  <script>
     10  'use strict';
     11  run_all_fp_tests_allow_all(
     12      'http://{{hosts[alt][]}}:{{ports[http][0]}}',
     13      'sync-xhr',
     14      'NetworkError',
     15      () => {
     16        return new Promise((resolve, reject) => {
     17          try {
     18            var xhr = new XMLHttpRequest();
     19            xhr.open("GET", "data:,", false);
     20            try {
     21              xhr.send();
     22            } catch(e) {
     23              reject(e);
     24            }
     25          } catch(e) {
     26            reject({"name": "UnexpectedException:" + e.name});
     27          }
     28          resolve();
     29       });
     30      });
     31  </script>
     32 </body>