tor-browser

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

all-permissions.html (1107B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>Test all known permissions support</title>
      4 <script src=/resources/testharness.js></script>
      5 <script src=/resources/testharnessreport.js></script>
      6 <div id="log"></div>
      7 
      8 <script>
      9  // These are marked "at risk" in the spec...
     10  const atRisk = [
     11    "accelerometer",
     12    "ambient-light-sensor",
     13    "background-fetch",
     14    "background-sync",
     15    "bluetooth",
     16    "gyroscope",
     17    "magnetometer",
     18    "midi",
     19    "nfc",
     20    "screen-wake-lock",
     21    "display-capture",
     22    "speaker-selection",
     23    "xr-spatial-tracking",
     24  ];
     25 
     26  // These are known to be supported by multiple engines...
     27  const permissions = [
     28    "camera",
     29    "geolocation",
     30    "microphone",
     31    "notifications",
     32    "persistent-storage",
     33    "push",
     34  ];
     35 
     36  for (const name of [...permissions, ...atRisk]) {
     37    promise_test(async (test) => {
     38      const status = await navigator.permissions.query({ name });
     39      assert_true(status instanceof PermissionStatus);
     40      //assert_equals(status.name, name, `permission's name should be "${name}"`);
     41    }, `Query "${name}" permission`);
     42  }
     43 </script>