tor-browser

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

same-origin-add-module-credentials-include.tentative.https.sub.html (958B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/common/utils.js"></script>
      5 <script src="/shared-storage/resources/util.js"></script>
      6 <script src="/fenced-frame/resources/utils.js"></script>
      7 
      8 <body>
      9 <script>
     10 'use strict';
     11 
     12 promise_test(async () => {
     13  const ancestor_key = token();
     14  document.cookie = "key0=value0";
     15  const helper_url = `/shared-storage/resources/credentials-test-helper.py`;
     16 
     17  await sharedStorage.worklet.addModule(
     18    helper_url + `?action=store-cookie&token=${ancestor_key}`,
     19    { credentials: "include" });
     20 
     21  const request_cookie_fetch_response =
     22    await fetch(helper_url + `?action=get-cookie&token=${ancestor_key}`);
     23 
     24  const request_cookie_text = await request_cookie_fetch_response.text();
     25 
     26  assert_equals(request_cookie_text, "key0=value0");
     27 }, 'addModule() with same-origin module script and credentials "include"');
     28 
     29 </script>
     30 </body>