Firefox Toolbar Development

For anyone working on a firefox toolbar/add-on here is an important tip. I have found that if I name my preferences manager (which is based off Components.interfaces.nsIPrefService) with the same name as another toolbar is using (specifically, another one that I built) the last one executed will retain the ability to use its preferences. In other words, the original one, because it has the same name, gets overwritten or re-used and loses its connection. I figured that since it gets instantiated on its own that it would not be stored in the same memory location, but since it definitely was the problem during my simultaneous development of two toolbars I can only conclude that it is global and has visibility across toolbars.

What does this mean? This means you can access the preferences of other toolbars. You can even check to see if the value is available before you use it (using a getPrefType call). This seems like a really big problem giving the open-source nature of the plugins and the security used for Yahoo!, Facebook or StumbleUpon toolbars. I don’t plan on hacking them anytime soon, but it sounds feasible given this architecture.