Getting the Main Window

Table of contents
No headers

You've probably created some kind of controller code on the main window for your extension, and you may need access to it from in a media page, from another window, or a display pane. In this case, you'll want to grab the main window like this:

var wMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"]
                                                    .getService(Components.interfaces.nsIWindowMediator);
var mainWindow = wMediator.getMostRecentWindow("Songbird:Main");

Tag page
You must login to post a comment.