Bug 1111022 - Changes UITour.jsm to work with windowless browsers. r=MattN

This commit is contained in:
Alessio Placitelli 2015-01-25 07:13:00 +01:00
Родитель deb826f3fb
Коммит 9a02041f82
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -344,6 +344,15 @@ this.UITour = {
onPageEvent: function(aMessage, aEvent) {
let browser = aMessage.target;
let window = browser.ownerDocument.defaultView;
// Does the window have tabs? We need to make sure since windowless browsers do
// not have tabs.
if (!window.gBrowser) {
// When using windowless browsers we don't have a valid |window|. If that's the case,
// use the most recent window as a target for UITour functions (see Bug 1111022).
window = Services.wm.getMostRecentWindow("navigator:browser");
}
let tab = window.gBrowser.getTabForBrowser(browser);
let messageManager = browser.messageManager;