зеркало из https://github.com/mozilla/pjs.git
Fix for bug 739898 (Stop using enablePrivilege in test_bug480509.html). r=bz.
This commit is contained in:
Родитель
3861c2399f
Коммит
a64967ff63
|
@ -66,8 +66,7 @@ function onWindowLoad()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
req.open("GET", "https://www.bank1.com/", false);
|
req.open("GET", "https://www.bank1.com/", false);
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
SpecialPowers.setPrivilegedProps(req, "channel.notificationCallbacks", certListener);
|
||||||
req.channel.notificationCallbacks = certListener;
|
|
||||||
req.send(null);
|
req.send(null);
|
||||||
}
|
}
|
||||||
catch(ex)
|
catch(ex)
|
||||||
|
|
|
@ -940,6 +940,23 @@ SpecialPowersAPI.prototype = {
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
setPrivilegedProps: function(obj, props, val) {
|
||||||
|
var parts = props.split('.');
|
||||||
|
|
||||||
|
if (parts.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < parts.length - 1; i++) {
|
||||||
|
var p = parts[i];
|
||||||
|
if (obj[p]) {
|
||||||
|
obj = obj[p];
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
obj[parts[i]] = val;
|
||||||
|
},
|
||||||
|
|
||||||
get focusManager() {
|
get focusManager() {
|
||||||
if (this._fm != null)
|
if (this._fm != null)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче