User Tools

Site Tools


developer_center:recipe_book:extensions_and_core:getting_the_main_window

Getting the Main Window

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");
developer_center/recipe_book/extensions_and_core/getting_the_main_window.txt · Last modified: 2013/12/28 08:56 by geekshadow