tor-browser

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

clipboard-write-enabled-by-feature-policy-attribute-cross-origin-tentative.https.sub.html (1223B)


      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-write.html';
     14 const cross_origin_src =
     15  'https://{{hosts[alt][]}}:{{ports[https][0]}}' + same_origin_src;
     16 
     17 // TODO(https://github.com/whatwg/html/issues/5493, https://crbug.com/1074482):
     18 // In Chrome and Firefox, Cross-origin focus requires user gesture. In Chrome
     19 // only, cross-origin focus is asynchronous. Implement WPT support for
     20 // cross-origin focus.
     21 promise_test(async t => {
     22  await waitForUserActivation();
     23  test_feature_availability(
     24    'navigator.clipboard.writeText("test text")',
     25    t,
     26    cross_origin_src,
     27    expect_feature_available_default,
     28    'clipboard-write'
     29  );
     30 }, 'Feature policy "clipboard-write" can be enabled in cross-origin iframe using allow="clipboard-write" attribute');
     31 </script>