tor-browser

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

disabled-by-permissions-policy.https.sub.html (918B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <meta charset="utf-8" />
      5    <title>WebShare Test: Can be disabled by permissions policy</title>
      6    <link rel="help" href="https://w3c.github.io/web-share/#permissions-policy">
      7    <script src="/resources/testharness.js"></script>
      8    <script src="/resources/testharnessreport.js"></script>
      9    <script src="/resources/testdriver.js"></script>
     10    <script src="/resources/testdriver-vendor.js"></script>
     11  </head>
     12  <body>
     13    <script>
     14      promise_test(async (t) => {
     15        await test_driver.bless("web share");
     16        await promise_rejects_dom(t, "NotAllowedError", navigator.share({}));
     17      }, "share() can be disabled by permissions policy");
     18 
     19      test((t) => {
     20        assert_false(
     21          navigator.canShare({ text: "foo" }),
     22          "not allowed to share"
     23        );
     24      }, "canShare() can be disabled by permissions policy");
     25    </script>
     26  </body>
     27 </html>