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
Родитель 17992acedf
Коммит 4de0ea3e6a
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -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);