[Project_owners] exchange data between instance

Biju G C bijumaillist at yahoo.com
Thu Sep 11 20:16:09 EDT 2003


Thanks...

 --- Pete Collins <pete at mozdev.org> wrote: 
> Biju G C wrote:
> > How can exchange data between my extensions, 
> > when two instance of it is running in two browser windows.
> 
> Through the DOM. Each window is part of the DOM.

I opened two windows and tried following in MacroEditor

  alert(window.nextSibling);        // gives undefined
  alert(window == window.parent);   // gives they are equal

so how do i navigate through opened windows

> You can use nsIWindowmediator to get each window object if need be.

I did not get how to use nsIWindowmediator for my purpose

I tried...

  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  const MEDIATOR_CONTRACTID="@mozilla.org/appshell/window-mediator;1";
  const nsIWindowMediator=Components.interfaces.nsIWindowMediator;
  var windowManager=
    Components.classes[MEDIATOR_CONTRACTID].getService(nsIWindowMediator);

  //var a = windowManager.getEnumerator();
  var a = windowManager.getXULWindowEnumerator();   

  b=a.getNext();

  while(a.hasMoreElements())
  {
    c=a.getNext();
    alert(c==b);
  }



________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk


More information about the Project_owners mailing list