tor-browser

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

shared-storage-writable-permissions-policy-none.tentative.https.sub.html (1533B)


      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 src=/shared-storage/resources/util.js></script>
      7  <script>
      8    'use strict';
      9    const header = 'permissions policy header shared-storage=()';
     10    const sameOriginUrl =
     11          '/shared-storage/resources/shared-storage-write.py';
     12    const crossOrigin = 'https://{{domains[www]}}:{{ports[https][0]}}';
     13    const crossOriginUrl = crossOrigin + sameOriginUrl;
     14 
     15    promise_test(async t => {
     16      let response = await fetch(sameOriginUrl,
     17                                 {sharedStorageWritable: true});
     18      let sharedStorageWritableHeader = await response.text();
     19      assert_equals(sharedStorageWritableHeader,
     20                    "NO_SHARED_STORAGE_WRITABLE_HEADER");
     21    }, header + ' disallows the \'Sec-Shared-Storage-Writable\' header to be '
     22              + 'sent for the same-origin shared storage fetch request.');
     23 
     24    promise_test(async t => {
     25      let response = await fetch(crossOriginUrl,
     26                                 {sharedStorageWritable: true});
     27      let sharedStorageWritableHeader = await response.text();
     28      assert_equals(sharedStorageWritableHeader,
     29                    "NO_SHARED_STORAGE_WRITABLE_HEADER");
     30    }, header + ' disallows the \'Sec-Shared-Storage-Writable\' header to be '
     31              + 'sent for the cross-origin shared storage fetch request.');
     32  </script>
     33 </body>