From 03838361880f97cf070896088dcb1f516f8ee8a7 Mon Sep 17 00:00:00 2001 From: "YUKI \"Piro\" Hiroshi" Date: Thu, 18 Apr 2019 15:55:59 +0900 Subject: [PATCH] Reduce needless API call --- src/js/background/backgroundLogic.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/background/backgroundLogic.js b/src/js/background/backgroundLogic.js index 89f9159..d84b2b3 100644 --- a/src/js/background/backgroundLogic.js +++ b/src/js/background/backgroundLogic.js @@ -238,7 +238,7 @@ const backgroundLogic = { }, async sortTabs() { - const windows = await browser.windows.getAll(); + const windows = await browser.windows.getAll({ populate: true }); for (let windowObj of windows) { // eslint-disable-line prefer-const // First the pinned tabs, then the normal ones. await this._sortTabsInternal(windowObj, true); @@ -247,7 +247,7 @@ const backgroundLogic = { }, async _sortTabsInternal(windowObj, pinnedTabs) { - const tabs = await browser.tabs.query({windowId: windowObj.id}); + const tabs = windowObj.tabs; let pos = 0; // Let's collect UCIs/tabs for this window.