A: 

If in your chrome manifest file you have something like:

 overlay chrome://browser/content/browser.xul chrome://path/to/youroverlay.xul

And that overlay has an include to somejsfile.js

and within somejsfile.js you have this:

var myExtension = {
    statusBarValue: "Not Initialized Yet",
    startup: function startup(){
     // Show statusBarValue in Status Bar Panel
     },
}

window.addEventListener("load", function() { myExtension.startup(); }, false);

Assuming everything I just said, when the user opens a new window, startup will run for each window and statusBarValue should be "Not Initialized Yet" regardless of what it is in another window.

Because you are overlaying browser.xul, and each window has it's own...each has it's own version of your extension. (Note that this is a new window, not a new tab.)

So yea, you'll probably have to sync them up somehow using a technique similar to what you mentioned.

MisterMister
That's about appearance part. I've also seen technique when each time UI element should be updated, all browser windows are enumerated and a function `applied` to all of them. Not sure how effective is this. One more point - how about static members, would that help?How about functionality part, like if I have a function of retrieving something periodically and I want only run 1 instance of that function periodically?
Michael
+1  A: 

https://developer.mozilla.org/en/Working_with_windows_in_chrome_code#Advanced_data_sharing

Import a js module (which you'll need to write) in all windows. That gives you an object shared across all of them.

In the module implement the timer code and either use the standard observer service to send out notifications to all windows (the timer callback calls .notify() whenever windows need to be updated, each window has an observer registered with the .addObserver()) or implement your own addObserver/removeObserver methods on the object exported from the jsm.

Nickolay
Exactly, worked like charm! Sorry for confusing. Spasibo bolshoe :)
Michael
@Michael: You're welcome!
Nickolay