зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1461130 - Don't convert filtered out windows in windows.getAll r=mixedpuppy
MozReview-Commit-ID: 2NkBIq5J4VF --HG-- extra : rebase_source : 94df1ebbc40ab14b760f6ded192f0f2fb5cc6960
This commit is contained in:
Родитель
af3c5e06a6
Коммит
d5d9fc268c
|
@ -110,15 +110,13 @@ this.windows = class extends ExtensionAPI {
|
|||
|
||||
getAll: function(getInfo) {
|
||||
let doNotCheckTypes = getInfo === null || getInfo.windowTypes === null;
|
||||
|
||||
function typeFilter(win) {
|
||||
return doNotCheckTypes || getInfo.windowTypes.includes(win.type);
|
||||
let windows = [];
|
||||
for (let win of windowManager.getAll()) {
|
||||
if (doNotCheckTypes || getInfo.windowTypes.includes(win.type)) {
|
||||
windows.push(win.convert(getInfo));
|
||||
}
|
||||
}
|
||||
|
||||
let windows = Array.from(windowManager.getAll(), win => win.convert(getInfo))
|
||||
.filter(typeFilter);
|
||||
|
||||
return Promise.resolve(windows);
|
||||
return windows;
|
||||
},
|
||||
|
||||
create: function(createData) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче