tor-browser

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

test_xhr_init.js (532B)


      1 function run_test() {
      2  var x = new XMLHttpRequest({ mozAnon: true, mozSystem: false });
      3  Assert.ok(x.mozAnon);
      4  Assert.ok(x.mozSystem); // Because we're system principal
      5 
      6  x = new XMLHttpRequest({ mozAnon: true });
      7  Assert.ok(x.mozAnon);
      8  Assert.ok(x.mozSystem);
      9 
     10  x = new XMLHttpRequest();
     11  Assert.ok(x.mozAnon);
     12  Assert.ok(x.mozSystem);
     13 
     14  Services.prefs.setBoolPref(
     15    "network.fetch.systemDefaultsToOmittingCredentials",
     16    false
     17  );
     18  x = new XMLHttpRequest();
     19  Assert.ok(!x.mozAnon);
     20  Assert.ok(x.mozSystem);
     21 }