Get a Firefox's window id (WId) under X11
问题 I'm trying to find out how to get a Firefox's X11 WId (window id) from within a Firefox addon/extension. Checked out nsIWindowMediator , nsIXULBrowserWindow , nsIXULWindow but haven't found it. I'd rather not go the usual way of (ab)using Xlib to search the window tree for one that matches the attributes of the current window like title, type and so on. 回答1: I think that the only place where you can get it is nsIEmbeddingSiteWindow.siteWindow (its type is GtkWidget* on Linux, it should be