mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Fix for bug 739898 (Stop using enablePrivilege in test_bug480509.html). r=bz.
This commit is contained in:
parent
34b94a5666
commit
21f90c4a0a
@ -66,8 +66,7 @@ function onWindowLoad()
|
||||
try
|
||||
{
|
||||
req.open("GET", "https://www.bank1.com/", false);
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
req.channel.notificationCallbacks = certListener;
|
||||
SpecialPowers.setPrivilegedProps(req, "channel.notificationCallbacks", certListener);
|
||||
req.send(null);
|
||||
}
|
||||
catch(ex)
|
||||
|
@ -940,6 +940,23 @@ SpecialPowersAPI.prototype = {
|
||||
}
|
||||
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() {
|
||||
if (this._fm != null)
|
||||
|
Loading…
Reference in New Issue
Block a user