tor-browser

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

active-document.window.js (836B)


      1 ["a",
      2 "area",
      3 "link"].forEach(type => {
      4  async_test(t => {
      5    const frame = document.createElement("iframe"),
      6          link = document.createElement(type);
      7    t.add_cleanup(() => frame.remove());
      8    frame.onload = t.step_func(() => {
      9      // See https://github.com/whatwg/html/issues/490
     10      if(frame.contentWindow.location.href === "about:blank")
     11        return;
     12      link.click(); // must be ignored because document is not active
     13      t.step_timeout(() => {
     14        assert_equals(frame.contentWindow.location.pathname, "/common/blank.html");
     15        t.done();
     16      }, 500);
     17    });
     18    document.body.appendChild(frame);
     19    frame.contentDocument.body.appendChild(link);
     20    link.href = "/";
     21    frame.src = "/common/blank.html";
     22  }, "<" + type + "> in navigated away <iframe>'s document cannot follow hyperlinks");
     23 });