exists = true; this._permissions[i].capability = capabilityString; this._permissions[i].perm = aCapability; 
   exists = this._permissions[i].perm == aCapability; 
  addPermission: function (aCapability)  {    var textbox = document.getElementById("url");    var host = textbox.value.replace(/^\s*([-\w]*:\/+)?/, ""); // trim any leading space and scheme    try {      var ioService = Components.classes["@mozilla.org/network/io-service;1"]                                .getService(Components.interfaces.nsIIOService);      var uri = ioService.newURI("http://"+host, null, null);      host = uri.host;    } catch(ex) {      var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]                                    .getService(Components.interfaces.nsIPromptService);      var message = this._bundle.getString("invalidURI");      var title = this._bundle.getString("invalidURITitle");      promptService.alert(window, title, message);      return;    }    var capabilityString = this._getCapabilityString(aCapability);    // check whether the permission already exists, if not, add it    var exists = false;    for (var i = 0; i < this._permissions.length; ++i) {      if (this._permissions[i].rawHost == host) {        exists = true;        this._permissions[i].capability = capabilityString;        this._permissions[i].perm = aCapability;        break;      }    }        if (!exists) {      host = (host.charAt(0) == ".") ? host.substring(1,host.length) : host;      var uri = ioService.newURI("http://" + host, null, null);      this._pm.add(uri, this._type, aCapability);    }    textbox.value = "";    textbox.focus();    // covers a case where the site exists already, so the buttons don't disable    this.onHostInput(textbox);    // enable "remove all" button as needed    document.getElementById("removeAllPermissions").disabled = this._permissions.length == 0;  },
5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5459/8acd482e753356dff68d88b8e42d3e1e04ba0760/permissions.js/clean/browser/components/preferences/permissions.js