tor-browser

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

permission.https.html (742B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8" />
      3 <title>Test geolocation is a powerful feature via Permissions API</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 
      7 <script>
      8  promise_test(async (test) => {
      9    const status = await navigator.permissions.query({ name: "geolocation" });
     10    assert_true(status instanceof PermissionStatus);
     11    assert_equals(
     12      status.name,
     13      "geolocation",
     14      `permission's name must be "geolocation"`
     15    );
     16    const states = ["prompt", "granted", "denied"];
     17    assert_true(
     18      states.includes(status.state),
     19      `permission's state must be one of ${states.join(", ")}`
     20    );
     21  }, `Query "geolocation" powerful feature`);
     22 </script>