Bug 877478 - Have SpecialPowers.addObserver modify the observe callback to wrap arguments. r=mrbkap

|subject| is quite often an XPCOM object that's not accessible to content.
This commit is contained in:
Bobby Holley 2013-06-04 19:56:42 -07:00
parent 6c466f082b
commit 5d40948d93

View File

@ -905,6 +905,8 @@ SpecialPowersAPI.prototype = {
},
addObserver: function(obs, notification, weak) {
if (typeof obs == 'object' && obs.observe.name != 'SpecialPowersCallbackWrapper')
obs.observe = wrapCallback(obs.observe);
var obsvc = Cc['@mozilla.org/observer-service;1']
.getService(Ci.nsIObserverService);
obsvc.addObserver(obs, notification, weak);