tor-browser

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

bailout-side-effects-same-origin-domain.sub.window.js (883B)


      1 // META: script=/html/resources/common.js
      2 // META: script=resources/document-open-side-effects.js
      3 
      4 document.domain = "{{host}}";
      5 
      6 testInIFrame("http://{{host}}:{{ports[http][1]}}/common/domain-setter.sub.html", (ctx) => {
      7  const iframe = ctx.iframes[0];
      8  const origURL = iframe.contentDocument.URL;
      9  assertDocumentIsReadyForSideEffectsTest(iframe.contentDocument, "same origin-domain (but not same origin) document");
     10  assert_throws_dom("SecurityError", iframe.contentWindow.DOMException, () => {
     11    ctx.iframes[0].contentDocument.open();
     12  }, "document.open() should throw a SecurityError on a same origin-domain (but not same origin) document");
     13  assertOpenHasNoSideEffects(iframe.contentDocument, origURL, "same origin-domain (but not same origin) document");
     14 }, "document.open bailout should not have any side effects (same origin-domain (but not same origin) document)");