Bug 897194: Use outer window ID to match toolbox to tab rather than assuming the currently-selected tab. r=bgrins

This commit is contained in:
Dave Camp 2013-10-29 10:47:16 -07:00
Родитель c09c677beb
Коммит 960780453b
2 изменённых файлов: 20 добавлений и 2 удалений

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

@ -306,7 +306,20 @@ TabTarget.prototype = {
this._client.connect((aType, aTraits) => {
this._client.listTabs(aResponse => {
this._root = aResponse;
this._form = aResponse.tabs[aResponse.selected];
let windowUtils = this.window
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
let outerWindow = windowUtils.outerWindowID;
aResponse.tabs.some((tab) => {
if (tab.outerWindowID === outerWindow) {
this._form = tab;
return true;
}
});
if (!this._form) {
this._form = aResponse.tabs[aResponse.selected];
}
attachTab();
});
});

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

@ -583,10 +583,15 @@ BrowserTabActor.prototype = {
dbg_assert(this.actorID,
"tab should have an actorID.");
let windowUtils = this.window
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
let response = {
actor: this.actorID,
title: this.title,
url: this.url
url: this.url,
outerWindowID: windowUtils.outerWindowID
};
// Walk over tab actors added by extensions and add them to a new ActorPool.