tor-browser

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

browser_privileges.js (506B)


      1 function test() {
      2  // simple test to confirm we have chrome privileges
      3  let hasPrivileges = true;
      4 
      5  // this will throw an exception if we are not running with privileges
      6  try {
      7    // eslint-disable-next-line no-unused-vars, mozilla/use-services
      8    var prefs = Cc["@mozilla.org/preferences-service;1"].getService(
      9      Ci.nsIPrefBranch
     10    );
     11  } catch (e) {
     12    hasPrivileges = false;
     13  }
     14 
     15  // if we get here, we must have chrome privileges
     16  ok(hasPrivileges, "running with chrome privileges");
     17 }