From a sidebar in Firefox 3.5 I am getting a reference to the main window with:
var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindow);
Then, mainWindow.title
is undefined (this works in Firefox 3.0).
I've also tried:
mainWindow.getBrowser().selectedBrowser.contentWindow.title (also undefined)
and it might be worth noting that
mainWindow.getBrowser().selectedBrowser.contentWindow.location.href
returns the correct URL.
Thanks! Noah