xiaoxiaoflood / firefox-scripts

userChromeJS / autoconfig.js and extensions
Mozilla Public License 2.0
954 stars 83 forks source link

bootstraploader not dispose addon sandbox or not reuse it properly? #115

Closed 117649 closed 2 years ago

117649 commented 2 years ago

I just found that for my legacy addon after restart it some of it function calls that initiated by timer or observer callback are running in a sandbox context of the last startup which is different from current one. And this cause malfunctions for my addon.

117649 commented 2 years ago

@xiaoxiaoflood https://github.com/xiaoxiaoflood/firefox-scripts/blob/f6d71250a02abe427b1ba7705c945fd46a59930a/chrome/utils/BootstrapLoader.jsm#L375-L378 I think what you really mean here is:

function findMethod(name) { 
   if (sandbox[name]) { 
     return sandbox[name]; 
   } 

?

xiaoxiaoflood commented 2 years ago

Yes... sure it's a bug, thanks.

But it wasn't me. BootstrapLoader is a product of Mozilla: https://hg.mozilla.org/mozilla-central/rev/061b97e02ede#l3.320