tor-browser

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

origin-from-location.window.js (554B)


      1 // META: title=`Origin.from(Location)`
      2 // META: script=/common/get-host-info.sub.js
      3 
      4 test(t => {
      5  assert_throws_js(TypeError, _ => Origin.from(window.location));
      6 }, `Origin.from(window.location) throws.`);
      7 
      8 async_test(t => {
      9  const el = document.createElement('iframe');
     10  el.src = get_host_info().REMOTE_ORIGIN + "/common/blank.html";
     11  el.onload = t.step_func_done(_ => {
     12    assert_throws_js(TypeError, _ => Origin.from(el.contentWindow.location));
     13  });
     14  document.body.appendChild(el);
     15 }, `Origin.from(Location) throws for cross-origin frames.`);