tor-browser

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

hid-allowed-by-permissions-policy-attribute-redirect-on-load.https.sub.html (1704B)


      1 <!DOCTYPE html>
      2 <body>
      3 <script src=/resources/testharness.js></script>
      4 <script src=/resources/testharnessreport.js></script>
      5 <script src=/permissions-policy/resources/permissions-policy.js></script>
      6 <script>
      7 'use strict';
      8 const relative_path = '/permissions-policy/resources/permissions-policy-hid.html';
      9 const base_src = '/permissions-policy/resources/redirect-on-load.html#';
     10 const relative_worker_frame_path =
     11    '/permissions-policy/resources/permissions-policy-hid-worker.html';
     12 const sub = 'https://{{domains[www]}}:{{ports[https][0]}}';
     13 const same_origin_src = base_src + relative_path;
     14 const cross_origin_src = base_src + sub + relative_path;
     15 const same_origin_worker_frame_src = base_src + relative_worker_frame_path;
     16 const cross_origin_worker_frame_src = base_src + sub +
     17    relative_worker_frame_path;
     18 const header = 'Permissions-Policy allow="hid"';
     19 
     20 async_test(t => {
     21  test_feature_availability(
     22      'hid.getDevices()', t, same_origin_src,
     23      expect_feature_available_default, 'hid');
     24 }, header + ' allows same-origin relocation.');
     25 
     26 async_test(t => {
     27  test_feature_availability(
     28      'hid.getDevices()', t, same_origin_worker_frame_src,
     29      expect_feature_available_default, 'hid');
     30 }, header + ' allows workers in same-origin relocation.');
     31 
     32 async_test(t => {
     33  test_feature_availability(
     34      'hid.getDevices()', t, cross_origin_src,
     35      expect_feature_unavailable_default, 'hid');
     36 }, header + ' disallows cross-origin relocation.');
     37 
     38 async_test(t => {
     39  test_feature_availability(
     40      'hid.getDevices()', t, cross_origin_worker_frame_src,
     41      expect_feature_unavailable_default, 'hid');
     42 }, header + ' disallows workers in cross-origin relocation.');
     43 </script>
     44 </body>