[Project_owners] Communicating between browser instances

Philip Chee philip.chee at gmail.com
Sun Jan 15 13:45:04 EST 2006


On Sat, 14 Jan 2006 20:13:14 -0800 (PST), Steven D Tine wrote:

> (proxy configured).  The problem is that when you have
> two browser windows open, the status bar is not in
> sync between the two windows.  By that I mean, when
> you click the icon in one window, the other window is
> not updated and the instance of the code in that
> window does not know that a change happened, so one
> window shows red and one shows green but obviously
> there is only one proxy setting for both windows so
> one window is wrong.  Is there a way for the code in
> the first instance to notify the code in the other
> window instances that a change was requested and
> completed?

> And to clarify my question, I don't just want to
> update the icon, but actually somehow notify my code
> in the other instance to update some state and then
> update the icon.

You basically set up a pref observer to monitor a preference setting and
when that setting changes you change your icon and state. Look at how
Flashblock does it. We have a toolbar button that changes image depending on
whether Flashblock is enabled or not. Clicking on the button will toggle the
enabled/disabled state. This change is propagated to all instances of the
toolbar button in each window.

Phil
-- 
Philip Chee <philip at aleytys.pc.my>, <philip.chee at gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]People with glass heads shouldn't.. ummm.. I forgot..
* TagZilla 0.059


More information about the Project_owners mailing list