tor-browser

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

bug839193.js (859B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 const nsIQuotaManagerService = Ci.nsIQuotaManagerService;
      6 
      7 var gURI = Services.io.newURI("http://localhost");
      8 
      9 function onUsageCallback() {}
     10 
     11 function onLoad() {
     12  var quotaManagerService = Cc[
     13    "@mozilla.org/dom/quota-manager-service;1"
     14  ].getService(nsIQuotaManagerService);
     15  let principal = Services.scriptSecurityManager.createContentPrincipal(
     16    gURI,
     17    {}
     18  );
     19  var quotaRequest = quotaManagerService.getUsageForPrincipal(
     20    principal,
     21    onUsageCallback
     22  );
     23  quotaRequest.cancel();
     24  Services.obs.notifyObservers(window, "bug839193-loaded");
     25 }
     26 
     27 function onUnload() {
     28  Services.obs.notifyObservers(window, "bug839193-unloaded");
     29 }