tor-browser

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

script-created-link-stylesheet-does-not-block-script.html (657B)


      1 <!DOCTYPE html>
      2 <title>Script-created link stylesheet is not script-blocking</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="support/utils.js"></script>
      6 <script>
      7 const link = document.createElement('link');
      8 link.rel = 'stylesheet';
      9 link.href = 'stylesheet.py?delay=1';
     10 document.head.appendChild(link);
     11 </script>
     12 <h1>Some text</h1>
     13 <script>
     14 test(() => {
     15  assert_false(styleExists("h1 { color: purple; }"),
     16               'stylesheet should still be pending');
     17  const h1 = document.querySelector('h1');
     18  assert_equals(getComputedStyle(h1).color, 'rgb(0, 0, 0)');
     19 });
     20 </script>