tor-browser

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

test_xray_named_element_access.js (604B)


      1 // See https://bugzilla.mozilla.org/show_bug.cgi?id=1273251
      2 "use strict";
      3 
      4 add_task(async function() {
      5  let webnav = Services.appShell.createWindowlessBrowser(false);
      6 
      7  let docShell = webnav.docShell;
      8 
      9  docShell.createAboutBlankDocumentViewer(null, null);
     10 
     11  let window = webnav.document.defaultView;
     12  let unwrapped = Cu.waiveXrays(window);
     13 
     14  window.document.body.innerHTML = '<div id="foo"></div>';
     15 
     16  equal(window.foo, undefined, "Should not have named X-ray property access");
     17  equal(typeof unwrapped.foo, "object", "Should always have non-X-ray named property access");
     18 
     19  webnav.close();
     20 });