[Project_owners] Q: how to access calling XUL window from XPCOM component code?

Malte Kraus firefox at maltekraus.de
Wed Feb 4 05:59:17 PST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Godmar Back schrieb:
> Would anybody happen to know how I can access/find out the calling XUL
> window within a method defined in global component code? (I could pass
> in 'window' into each method, but I'm hoping for a simpler way.)
As long as the caller used wrappedJSObject, you can do this:

function name() {
  var win = name.caller.__parent__;
}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmJnzEACgkQU9AX8TCX8cs9VgCfScBiy6r1G+E37YZb9X++Cpi4
QE0AoKdhTrPenHSEQ4F0uo9gfopJDkrs
=1Yge
-----END PGP SIGNATURE-----


More information about the Project_owners mailing list