283694 - cannot add cookie permissions. also fix annoying exception on startup
git-svn-id: svn://10.0.0.236/trunk@169926 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
4e459350d2
commit
0d84685ed4
@ -83,10 +83,10 @@ var gPermissionManager = {
|
|||||||
getCellProperties: function(row,column,prop){}
|
getCellProperties: function(row,column,prop){}
|
||||||
},
|
},
|
||||||
|
|
||||||
_getCapabilityString: function (aPermission)
|
_getCapabilityString: function (aCapability)
|
||||||
{
|
{
|
||||||
var stringKey = null;
|
var stringKey = null;
|
||||||
switch (aPermission.capability) {
|
switch (aCapability) {
|
||||||
case nsIPermissionManager.ALLOW_ACTION:
|
case nsIPermissionManager.ALLOW_ACTION:
|
||||||
stringKey = "can";
|
stringKey = "can";
|
||||||
break;
|
break;
|
||||||
@ -100,7 +100,7 @@ var gPermissionManager = {
|
|||||||
return this._bundle.getString(stringKey);
|
return this._bundle.getString(stringKey);
|
||||||
},
|
},
|
||||||
|
|
||||||
addPermission: function (aPermission)
|
addPermission: function (aCapability)
|
||||||
{
|
{
|
||||||
var textbox = document.getElementById("url");
|
var textbox = document.getElementById("url");
|
||||||
var host = textbox.value.replace(/^\s*([-\w]*:\/+)?/, ""); // trim any leading space and scheme
|
var host = textbox.value.replace(/^\s*([-\w]*:\/+)?/, ""); // trim any leading space and scheme
|
||||||
@ -117,7 +117,7 @@ var gPermissionManager = {
|
|||||||
promptservice.alert(window,title,message);
|
promptservice.alert(window,title,message);
|
||||||
}
|
}
|
||||||
|
|
||||||
var capabilityString = this._getCapabilityString(aPermission);
|
var capabilityString = this._getCapabilityString(aCapability);
|
||||||
|
|
||||||
// check whether the permission already exists, if not, add it
|
// check whether the permission already exists, if not, add it
|
||||||
var exists = false;
|
var exists = false;
|
||||||
@ -125,7 +125,7 @@ var gPermissionManager = {
|
|||||||
if (this._permissions[i].rawHost == host) {
|
if (this._permissions[i].rawHost == host) {
|
||||||
exists = true;
|
exists = true;
|
||||||
this._permissions[i].capability = capabilityString;
|
this._permissions[i].capability = capabilityString;
|
||||||
this._permissions[i].perm = aPermission;
|
this._permissions[i].perm = aCapability;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -135,7 +135,7 @@ var gPermissionManager = {
|
|||||||
(host.charAt(0) == ".") ? host.substring(1,host.length) : host,
|
(host.charAt(0) == ".") ? host.substring(1,host.length) : host,
|
||||||
this._type,
|
this._type,
|
||||||
capabilityString,
|
capabilityString,
|
||||||
aPermission);
|
aCapability);
|
||||||
this._permissions.push(p);
|
this._permissions.push(p);
|
||||||
|
|
||||||
this._view._rowCount = this._permissions.length;
|
this._view._rowCount = this._permissions.length;
|
||||||
@ -227,7 +227,7 @@ var gPermissionManager = {
|
|||||||
else if (aData == "changed") {
|
else if (aData == "changed") {
|
||||||
for (var i = 0; i < this._permissions.length; ++i) {
|
for (var i = 0; i < this._permissions.length; ++i) {
|
||||||
if (this._permissions[i].host == permission.host) {
|
if (this._permissions[i].host == permission.host) {
|
||||||
this._permissions[i].capability = this._getCapabilityString(permission);
|
this._permissions[i].capability = this._getCapabilityString(permission.capability);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -331,7 +331,7 @@ var gPermissionManager = {
|
|||||||
{
|
{
|
||||||
if (aPermission.type == this._type) {
|
if (aPermission.type == this._type) {
|
||||||
var host = aPermission.host;
|
var host = aPermission.host;
|
||||||
var capabilityString = this._getCapabilityString(aPermission);
|
var capabilityString = this._getCapabilityString(aPermission.capability);
|
||||||
var p = new Permission(host,
|
var p = new Permission(host,
|
||||||
(host.charAt(0) == ".") ? host.substring(1,host.length) : host,
|
(host.charAt(0) == ".") ? host.substring(1,host.length) : host,
|
||||||
aPermission.type,
|
aPermission.type,
|
||||||
|
|||||||
@ -77,13 +77,16 @@ var nsDefaultCLH = {
|
|||||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||||
.getService(nsIPrefBranch);
|
.getService(nsIPrefBranch);
|
||||||
|
|
||||||
// if the pref is missing, just let the exception fall through
|
// if the pref is missing, ignore the exception
|
||||||
var chromeURI = prefs.getCharPref("toolkit.defaultChromeURI");
|
try {
|
||||||
|
var chromeURI = prefs.getCharPref("toolkit.defaultChromeURI");
|
||||||
|
|
||||||
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
|
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
|
||||||
.getService(nsIWindowWatcher);
|
.getService(nsIWindowWatcher);
|
||||||
wwatch.openWindow(null, chromeURI, "_blank",
|
wwatch.openWindow(null, chromeURI, "_blank",
|
||||||
"chrome,dialog=no,all", cmdLine);
|
"chrome,dialog=no,all", cmdLine);
|
||||||
|
}
|
||||||
|
catch (e) { }
|
||||||
},
|
},
|
||||||
|
|
||||||
helpInfo : "",
|
helpInfo : "",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user