tor-browser

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

clipboard-read-enabled-by-feature-policy.tentative.https.sub.html (1116B)


      1 <!doctype html>
      2 <body>Body needed for test_driver.click()</body>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/resources/testdriver.js"></script>
      6 <script src="/resources/testdriver-vendor.js"></script>
      7 <script src="/feature-policy/resources/featurepolicy.js"></script>
      8 <script src="../../resources/user-activation.js"></script>
      9 <script>
     10 'use strict';
     11 
     12 const same_origin_src =
     13  '/feature-policy/resources/feature-policy-clipboard-read.html';
     14 const cross_origin_src =
     15  'https://{{hosts[alt][]}}:{{ports[https][0]}}' + same_origin_src;
     16 
     17 promise_test(async t => {
     18  await tryGrantReadPermission();
     19  await waitForUserActivation();
     20  await navigator.clipboard.readText('test text');
     21 }, 'Feature-Policy header clipboard-read "*" allows the top-level document.');
     22 
     23 promise_test(async t => {
     24  await waitForUserActivation();
     25  test_feature_availability(
     26    'navigator.clipboard.readText()',
     27    t,
     28    same_origin_src,
     29    expect_feature_available_default
     30  );
     31 }, 'Feature-Policy header clipboard-read "*" allows same-origin iframes.');
     32 </script>