tor-browser

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

navigate-relative-url-utf8.html (962B)


      1 <!doctype html>
      2 <meta charset={{GET[encoding]}}> <!-- ends up as <meta charset> by default which is windows-1252 -->
      3 <meta name=variant content="?encoding=windows-1252">
      4 <meta name=variant content="?encoding=x-cp1251">
      5 <meta name=variant content="?encoding=utf8">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <iframe id="i" src="/common/blank.html"></iframe>
      9 <!-- Test for https://github.com/whatwg/html/pull/9756 -->
     10 
     11 <script>
     12 async_test(t => {
     13  window.onload = t.step_func(() => {
     14    i.contentWindow.navigation.navigate("?\u00FF");
     15 
     16    i.onload = t.step_func_done(() => {
     17      const iframeURL = new URL(i.contentWindow.navigation.currentEntry.url);
     18      assert_equals(iframeURL.pathname, "/common/blank.html", "pathname");
     19      assert_equals(iframeURL.search, "?%C3%BF", "search");
     20    });
     21  });
     22 }, "navigate() should resolve URLs assuming UTF-8, ignoring the document's encoding");
     23 </script>