tor-browser

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

get.html (1125B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8" />
      3 <script src="/resources/testdriver.js"></script>
      4 <script src="/resources/testdriver-vendor.js"></script>
      5 <script type="module">
      6    import { makeGetOptions } from "/digital-credentials/support/helper.js";
      7    const type = "availability-result";
      8    async function notify() {
      9        if (!navigator.userActivation.isActive) {
     10            await test_driver.bless("user activation", null, window);
     11        }
     12        let enabled = undefined;
     13        try {
     14            await navigator.credentials.get(makeGetOptions({protocol: []}));
     15        } catch (e) {
     16            switch (e.name) {
     17                case "NotAllowedError":
     18                    enabled = false;
     19                    break;
     20                case "TypeError":
     21                    enabled = true;
     22                    break;
     23                default:
     24                    throw e;
     25            }
     26        } finally {
     27            window.parent.postMessage({ type, enabled }, "*");
     28        }
     29    }
     30    test_driver.set_test_context(parent);
     31    window.onload = notify;
     32 </script>
     33 <body>
     34    <h1>Digital Credentials iframe</h1>
     35 </body>