开发者

Is it normal behavior that for every Firefox window, another instance of my addon is created?

I'm creating my 2nd Firefox addon, and I've noticed that when another window is created another instanc开发者_如何学JAVAe of my addon is created too. Is this because I've put my main javascript in an overlay, when I shouldn't have? What is the right way to do this?


That is the normal behaviour and yes, it is because you use/load the code in an overlay. Afaik this is the only way to initialize an add-on anyway (maybe there are other ways now with the Add-on SDK).

In order to share state between the windows, you have to use JavaScript code modules.

If you are just starting with the add-on, I really suggest you have a look at the new SDK. It is supposed to make the development much simpler.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜