Michael Vincent van Rantwijk, MultiZilla wrote:

> Christian Arnold wrote:
>
>> function statusbarIcon(iconVisible) {
>>     var wm = 
>> Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
>>  
>>
>>     var type = 'navigator:browser'
>>     var enumerator = wm.getEnumerator(type);
>>     while(enumerator.hasMoreElements()) {
>>         var win = enumerator.getNext();
>>         var panel = 
>> win.document.getElementById("your-extension-statusbarpanel");
>>         panel.hidden = iconVisible;
>>     }
>> }
>>
>> The XUL-Part:
>> <checkbox id="prefstatusbarvisible" preference="statusbarvisible" 
>> label="&prefstatusbarvisible.label;" onclick="return 
>> statusbarIcon(this.checked);"/>
>
> Don't use code like this, but use the observer service to notify all 
> open windows.

Better still, use the preference service - you are after all setting 
preferences...
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to